Expanded table functionality.
This commit is contained in:
parent
cf32f494ad
commit
fd2204feb7
|
@ -25,3 +25,7 @@ func get_model() -> PackedScene:
|
|||
if model == null:
|
||||
model = _create_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)
|
||||
texture.create_from_image(image, 0)
|
||||
_presage_changes()
|
||||
for i in range(row_size):
|
||||
image.set_pixel(i, 0,
|
||||
Color(1.0, 0.0, 0.0))
|
||||
image.fill(Color.red)
|
||||
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():
|
||||
if dirty_flag:
|
||||
image.unlock()
|
||||
|
|
Loading…
Reference in New Issue
Block a user