1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-19 01:29:49 +00:00

Move _fill_bitmap_with_points() to BaseTool.gd

This commit is contained in:
Emmanouil Papadeas 2022-09-08 13:42:03 +03:00
parent ffd6c8c88d
commit e7678ef5cc
5 changed files with 12 additions and 44 deletions

View file

@ -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:

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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