mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-18 17:19:50 +00:00
Move _fill_bitmap_with_points() to BaseTool.gd
This commit is contained in:
parent
ffd6c8c88d
commit
e7678ef5cc
|
@ -125,6 +125,18 @@ func _create_polylines(bitmap: BitMap) -> Array:
|
|||
return lines
|
||||
|
||||
|
||||
func _fill_bitmap_with_points(points: Array, size: Vector2) -> BitMap:
|
||||
var bitmap := BitMap.new()
|
||||
bitmap.create(size)
|
||||
|
||||
for point in points:
|
||||
if point.x < 0 or point.y < 0 or point.x >= size.x or point.y >= size.y:
|
||||
continue
|
||||
bitmap.set_bit(point, 1)
|
||||
|
||||
return bitmap
|
||||
|
||||
|
||||
func _add_polylines_segment(lines: Array, start: Vector2, end: Vector2) -> void:
|
||||
for line in lines:
|
||||
if line[0] == start:
|
||||
|
|
|
@ -168,13 +168,3 @@ func _get_ellipse_points(pos: Vector2, size: Vector2) -> Array:
|
|||
y1 -= 1
|
||||
|
||||
return array
|
||||
|
||||
|
||||
func _fill_bitmap_with_points(points: Array, size: Vector2) -> BitMap:
|
||||
var bitmap := BitMap.new()
|
||||
bitmap.create(size)
|
||||
|
||||
for point in points:
|
||||
bitmap.set_bit(point, 1)
|
||||
|
||||
return bitmap
|
||||
|
|
|
@ -255,13 +255,3 @@ func _get_ellipse_points(pos: Vector2, size: Vector2) -> Array:
|
|||
y1 -= 1
|
||||
|
||||
return array
|
||||
|
||||
|
||||
func _fill_bitmap_with_points(points: Array, size: Vector2) -> BitMap:
|
||||
var bitmap := BitMap.new()
|
||||
bitmap.create(size)
|
||||
|
||||
for point in points:
|
||||
bitmap.set_bit(point, 1)
|
||||
|
||||
return bitmap
|
||||
|
|
|
@ -150,18 +150,6 @@ func append_gap(start: Vector2, end: Vector2) -> void:
|
|||
_draw_points.append(Vector2(x, y))
|
||||
|
||||
|
||||
func _fill_bitmap_with_points(points: Array, size: Vector2) -> BitMap:
|
||||
var bitmap := BitMap.new()
|
||||
bitmap.create(size)
|
||||
|
||||
for point in points:
|
||||
if point.x < 0 or point.y < 0 or point.x >= size.x or point.y >= size.y:
|
||||
continue
|
||||
bitmap.set_bit(point, 1)
|
||||
|
||||
return bitmap
|
||||
|
||||
|
||||
func mirror_array(array: Array, h: bool, v: bool) -> Array:
|
||||
var new_array := []
|
||||
var project: Project = Global.current_project
|
||||
|
|
|
@ -188,18 +188,6 @@ func append_gap(start: Vector2, end: Vector2, array: Array) -> void:
|
|||
array.append(Vector2(x, y))
|
||||
|
||||
|
||||
func _fill_bitmap_with_points(points: Array, size: Vector2) -> BitMap:
|
||||
var bitmap := BitMap.new()
|
||||
bitmap.create(size)
|
||||
|
||||
for point in points:
|
||||
if point.x < 0 or point.y < 0 or point.x >= size.x or point.y >= size.y:
|
||||
continue
|
||||
bitmap.set_bit(point, 1)
|
||||
|
||||
return bitmap
|
||||
|
||||
|
||||
func mirror_array(array: Array, h: bool, v: bool) -> Array:
|
||||
var new_array := []
|
||||
var project: Project = Global.current_project
|
||||
|
|
Loading…
Reference in a new issue