Expanded table functionality.
This commit is contained in:
parent
cf32f494ad
commit
fd2204feb7
|
@ -25,3 +25,7 @@ func get_model() -> PackedScene:
|
||||||
if model == null:
|
if model == null:
|
||||||
model = _create_model()
|
model = _create_model()
|
||||||
return model
|
return model
|
||||||
|
|
||||||
|
|
||||||
|
func get_allocation_size() -> int:
|
||||||
|
return 0
|
||||||
|
|
|
@ -15,9 +15,7 @@ func create():
|
||||||
image.create(row_size, 1, false, Image.FORMAT_RGBAF)
|
image.create(row_size, 1, false, Image.FORMAT_RGBAF)
|
||||||
texture.create_from_image(image, 0)
|
texture.create_from_image(image, 0)
|
||||||
_presage_changes()
|
_presage_changes()
|
||||||
for i in range(row_size):
|
image.fill(Color.red)
|
||||||
image.set_pixel(i, 0,
|
|
||||||
Color(1.0, 0.0, 0.0))
|
|
||||||
flush()
|
flush()
|
||||||
|
|
||||||
|
|
||||||
|
@ -32,6 +30,23 @@ func apply_matrix(matrix: SummerDayMatrix4, row: int, position: int):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
func add_row():
|
||||||
|
_presage_changes()
|
||||||
|
image.crop(image.get_width(), image.get_height() + 1)
|
||||||
|
|
||||||
|
|
||||||
|
func remove_row(at: int):
|
||||||
|
_presage_changes()
|
||||||
|
var size = image.get_size()
|
||||||
|
var below_height = size.y - 1
|
||||||
|
if at < below_height:
|
||||||
|
image.blit_rect(image,
|
||||||
|
Rect2(Vector2(0, at + 1), Vector2(size.x, below_height - at)),
|
||||||
|
Vector2(Vector2(0, at))
|
||||||
|
)
|
||||||
|
image.crop(size.x, below_height)
|
||||||
|
|
||||||
|
|
||||||
func flush():
|
func flush():
|
||||||
if dirty_flag:
|
if dirty_flag:
|
||||||
image.unlock()
|
image.unlock()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user