Format files and remove trailing spaces

This commit is contained in:
Aaron Franke 2020-12-04 16:23:51 -05:00
parent 5ab629b438
commit 715e737e6f
No known key found for this signature in database
GPG Key ID: 40A1750B977E56BF
8 changed files with 35 additions and 35 deletions

4
.gitignore vendored
View File

@ -1,4 +1,4 @@
.import/ .import/
export.cfg export.cfg
export_presets.cfg export_presets.cfg
@ -12,4 +12,4 @@ data_*/
#Godoxel #Godoxel
addons/godot-plugin-refresher/ addons/godot-plugin-refresher/

View File

@ -19,4 +19,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.

View File

@ -14,7 +14,7 @@ const list = [
Vector2(-1, 0), Vector2(0, 0), Vector2(1, 0), Vector2(-1, 0), Vector2(0, 0), Vector2(1, 0),
], ],
[ Vector2(0, -1), [ Vector2(0, -1),
Vector2(0, 0), Vector2(0, 0),
Vector2(0, 1) Vector2(0, 1)
] ]
] ]

View File

@ -154,7 +154,7 @@ func get_content_margin() -> Rect2:
if r.size.y > rect.size.y: if r.size.y > rect.size.y:
rect.size.y = r.size.y rect.size.y = r.size.y
return rect return rect
func crop_to_content(): func crop_to_content():
@ -286,7 +286,7 @@ func select_layer(layer_name: String):
#------------------------------- #-------------------------------
# Check # Check
#------------------------------- #-------------------------------
func _on_mouse_entered(): func _on_mouse_entered():
@ -311,7 +311,7 @@ func is_inside_canvas(x, y):
#------------------------------- #-------------------------------
#Note: Arrays are always passed by reference. To get a copy of an array which #Note: Arrays are always passed by reference. To get a copy of an array which
# can be modified independently of the original array, use duplicate. # can be modified independently of the original array, use duplicate.
# (https://docs.godotengine.org/en/stable/classes/class_array.html) # (https://docs.godotengine.org/en/stable/classes/class_array.html)
func set_pixel_arr(pixels: Array, color: Color): func set_pixel_arr(pixels: Array, color: Color):
@ -362,7 +362,7 @@ func get_preview_pixel_v(pos: Vector2):
func get_preview_pixel(x: int, y: int): func get_preview_pixel(x: int, y: int):
if not preview_layer: if not preview_layer:
return null return null
return preview_layer.get_pixel(x, y) return preview_layer.get_pixel(x, y)
@ -407,7 +407,7 @@ func select_same_color(x, y):
# returns array of Vector2 # returns array of Vector2
# yoinked from # yoinked from
# https://www.geeksforgeeks.org/flood-fill-algorithm-implement-fill-paint/ # https://www.geeksforgeeks.org/flood-fill-algorithm-implement-fill-paint/
func get_neighbouring_pixels(pos_x: int, pos_y: int) -> Array: func get_neighbouring_pixels(pos_x: int, pos_y: int) -> Array:
var pixels = [] var pixels = []

View File

@ -6,7 +6,7 @@ signal color_change_request
func _enter_tree(): func _enter_tree():
for child in get_children(): for child in get_children():
child.set("custom_styles/normal", StyleBoxFlat.new()) child.set("custom_styles/normal", StyleBoxFlat.new())
child.get("custom_styles/normal").set("bg_color", Color(randf(), randf(), randf())) child.get("custom_styles/normal").set("bg_color", Color(randf(), randf(), randf()))
for child in get_children(): for child in get_children():
if child.is_connected("pressed", self, "change_color_to"): if child.is_connected("pressed", self, "change_color_to"):
return return
@ -22,7 +22,7 @@ func add_color_prefab(color: Color):
add_child(dup) add_child(dup)
move_child(dup, 0) move_child(dup, 0)
dup.set("custom_styles/normal", StyleBoxFlat.new()) dup.set("custom_styles/normal", StyleBoxFlat.new())
dup.get("custom_styles/normal").set("bg_color", color) dup.get("custom_styles/normal").set("bg_color", color)
for child in get_children(): for child in get_children():
if child.is_connected("pressed", self, "change_color_to"): if child.is_connected("pressed", self, "change_color_to"):
return return

View File

@ -203,7 +203,7 @@ func _process(delta):
canvas_mouse_position = Vector2(mouse_position.x - canvas_position.x, mouse_position.y - canvas_position.y) canvas_mouse_position = Vector2(mouse_position.x - canvas_position.x, mouse_position.y - canvas_position.y)
if is_mouse_in_canvas(): if is_mouse_in_canvas():
cell_mouse_position = Vector2( cell_mouse_position = Vector2(
floor(canvas_mouse_position.x / grid_size), floor(canvas_mouse_position.x / grid_size),
floor(canvas_mouse_position.y / grid_size)) floor(canvas_mouse_position.y / grid_size))
cell_color = paint_canvas.get_pixel(cell_mouse_position.x, cell_mouse_position.y) cell_color = paint_canvas.get_pixel(cell_mouse_position.x, cell_mouse_position.y)
update_text_info() update_text_info()
@ -286,22 +286,22 @@ func _draw_tool_brush():
var pixels = BrushPrefabs.get_brush(selected_brush_prefab, find_node("BrushSize").value) var pixels = BrushPrefabs.get_brush(selected_brush_prefab, find_node("BrushSize").value)
for pixel in pixels: for pixel in pixels:
paint_canvas._set_pixel(paint_canvas.tool_layer, paint_canvas._set_pixel(paint_canvas.tool_layer,
cell_mouse_position.x + pixel.x, cell_mouse_position.y + pixel.y, selected_color) cell_mouse_position.x + pixel.x, cell_mouse_position.y + pixel.y, selected_color)
Tools.RAINBOW: Tools.RAINBOW:
paint_canvas._set_pixel(paint_canvas.tool_layer, paint_canvas._set_pixel(paint_canvas.tool_layer,
cell_mouse_position.x, cell_mouse_position.y, Color(0.46875, 0.446777, 0.446777, 0.196078)) cell_mouse_position.x, cell_mouse_position.y, Color(0.46875, 0.446777, 0.446777, 0.196078))
Tools.COLORPICKER: Tools.COLORPICKER:
paint_canvas._set_pixel(paint_canvas.tool_layer, paint_canvas._set_pixel(paint_canvas.tool_layer,
cell_mouse_position.x, cell_mouse_position.y, Color(0.866667, 0.847059, 0.847059, 0.196078)) cell_mouse_position.x, cell_mouse_position.y, Color(0.866667, 0.847059, 0.847059, 0.196078))
_: _:
paint_canvas._set_pixel(paint_canvas.tool_layer, paint_canvas._set_pixel(paint_canvas.tool_layer,
cell_mouse_position.x, cell_mouse_position.y, selected_color) cell_mouse_position.x, cell_mouse_position.y, selected_color)
paint_canvas.update() paint_canvas.update()
#TODO add here brush prefab drawing #TODO add here brush prefab drawing
paint_canvas.tool_layer.update_texture() paint_canvas.tool_layer.update_texture()
@ -312,7 +312,7 @@ func _handle_scroll():
_middle_mouse_pressed_pos = get_global_mouse_position() _middle_mouse_pressed_pos = get_global_mouse_position()
paint_canvas.rect_position = _middle_mouse_pressed_start_pos paint_canvas.rect_position = _middle_mouse_pressed_start_pos
paint_canvas.rect_position += get_global_mouse_position() - _middle_mouse_pressed_pos paint_canvas.rect_position += get_global_mouse_position() - _middle_mouse_pressed_pos
elif _middle_mouse_pressed_start_pos != null: elif _middle_mouse_pressed_start_pos != null:
_middle_mouse_pressed_start_pos = null _middle_mouse_pressed_start_pos = null
@ -386,7 +386,7 @@ func brush_process():
Tools.PAINT: Tools.PAINT:
do_action([cell_mouse_position, last_cell_mouse_position, selected_color]) do_action([cell_mouse_position, last_cell_mouse_position, selected_color])
Tools.BRUSH: Tools.BRUSH:
do_action([cell_mouse_position, last_cell_mouse_position, selected_color, do_action([cell_mouse_position, last_cell_mouse_position, selected_color,
selected_brush_prefab, find_node("BrushSize").value]) selected_brush_prefab, find_node("BrushSize").value])
Tools.LINE: Tools.LINE:
do_action([cell_mouse_position, last_cell_mouse_position, selected_color]) do_action([cell_mouse_position, last_cell_mouse_position, selected_color])
@ -401,7 +401,7 @@ func brush_process():
Tools.CUT: Tools.CUT:
do_action([cell_mouse_position, last_cell_mouse_position, selected_color]) do_action([cell_mouse_position, last_cell_mouse_position, selected_color])
Tools.PASTECUT: Tools.PASTECUT:
do_action([cell_mouse_position, last_cell_mouse_position, do_action([cell_mouse_position, last_cell_mouse_position,
_selection_cells, _selection_colors, _selection_cells, _selection_colors,
_cut_pos, _cut_size]) _cut_pos, _cut_size])
Tools.RAINBOW: Tools.RAINBOW:
@ -417,7 +417,7 @@ func brush_process():
Tools.PAINT: Tools.PAINT:
do_action([cell_mouse_position, last_cell_mouse_position, Color.transparent]) do_action([cell_mouse_position, last_cell_mouse_position, Color.transparent])
Tools.BRUSH: Tools.BRUSH:
do_action([cell_mouse_position, last_cell_mouse_position, Color.transparent, do_action([cell_mouse_position, last_cell_mouse_position, Color.transparent,
selected_brush_prefab, find_node("BrushSize").value]) selected_brush_prefab, find_node("BrushSize").value])
else: else:
if _current_action and _current_action.can_commit(): if _current_action and _current_action.can_commit():
@ -494,7 +494,7 @@ func redo_action():
return return
var action = _redo_history.pop_back() var action = _redo_history.pop_back()
if not action: if not action:
return return
_actions_history.append(action) _actions_history.append(action)
action.redo_action(paint_canvas) action.redo_action(paint_canvas)
paint_canvas.update() paint_canvas.update()
@ -663,7 +663,7 @@ func add_new_layer():
_layer_button_ref[new_layer_button.name] = new_layer_button _layer_button_ref[new_layer_button.name] = new_layer_button
_connect_layer_buttons() _connect_layer_buttons()
var layer: GELayer = paint_canvas.add_new_layer(new_layer_button.name) var layer: GELayer = paint_canvas.add_new_layer(new_layer_button.name)
highlight_layer(paint_canvas.get_active_layer().name) highlight_layer(paint_canvas.get_active_layer().name)
#print("added layer: ", layer.name) #print("added layer: ", layer.name)
@ -691,12 +691,12 @@ func duplicate_active_layer():
_total_added_layers += 1 # for keeping track... _total_added_layers += 1 # for keeping track...
new_layer_button.find_node("Select").text = "Layer " + str(_total_added_layers) new_layer_button.find_node("Select").text = "Layer " + str(_total_added_layers)
var new_layer = paint_canvas.duplicate_layer(paint_canvas.active_layer.name, new_layer_button.name) var new_layer = paint_canvas.duplicate_layer(paint_canvas.active_layer.name, new_layer_button.name)
new_layer.update_texture() new_layer.update_texture()
_layer_button_ref[new_layer.name] = new_layer_button _layer_button_ref[new_layer.name] = new_layer_button
new_layer_button.find_node("Select").connect("pressed", self, "select_layer", [new_layer_button.name]) new_layer_button.find_node("Select").connect("pressed", self, "select_layer", [new_layer_button.name])
new_layer_button.find_node("Visible").connect("pressed", self, "toggle_layer_visibility", new_layer_button.find_node("Visible").connect("pressed", self, "toggle_layer_visibility",
[new_layer_button.find_node("Visible"), new_layer_button.name]) [new_layer_button.find_node("Visible"), new_layer_button.name])
new_layer_button.find_node("Up").connect("pressed", self, "move_down", [new_layer_button]) new_layer_button.find_node("Up").connect("pressed", self, "move_down", [new_layer_button])
new_layer_button.find_node("Down").connect("pressed", self, "move_up", [new_layer_button]) new_layer_button.find_node("Down").connect("pressed", self, "move_up", [new_layer_button])
@ -726,11 +726,11 @@ func _connect_layer_buttons():
if layer_btn.find_node("Select").is_connected("pressed", self, "select_layer"): if layer_btn.find_node("Select").is_connected("pressed", self, "select_layer"):
continue continue
layer_btn.find_node("Select").connect("pressed", self, "select_layer", [layer_btn.name]) layer_btn.find_node("Select").connect("pressed", self, "select_layer", [layer_btn.name])
layer_btn.find_node("Visible").connect("pressed", self, "toggle_layer_visibility", layer_btn.find_node("Visible").connect("pressed", self, "toggle_layer_visibility",
[layer_btn.find_node("Visible"), layer_btn.name]) [layer_btn.find_node("Visible"), layer_btn.name])
layer_btn.find_node("Up").connect("pressed", self, "move_down", [layer_btn]) layer_btn.find_node("Up").connect("pressed", self, "move_down", [layer_btn])
layer_btn.find_node("Down").connect("pressed", self, "move_up", [layer_btn]) layer_btn.find_node("Down").connect("pressed", self, "move_up", [layer_btn])
layer_btn.find_node("Lock").connect("pressed", self, "lock_layer", layer_btn.find_node("Lock").connect("pressed", self, "lock_layer",
[layer_btn, layer_btn.name]) [layer_btn, layer_btn.name])
@ -739,7 +739,7 @@ func _on_Button_pressed():
func _on_PaintCanvasContainer_mouse_entered(): func _on_PaintCanvasContainer_mouse_entered():
if mouse_on_top == true: if mouse_on_top:
return return
mouse_on_top = true mouse_on_top = true
paint_canvas.tool_layer.clear() paint_canvas.tool_layer.clear()
@ -748,7 +748,7 @@ func _on_PaintCanvasContainer_mouse_entered():
func _on_PaintCanvasContainer_mouse_exited(): func _on_PaintCanvasContainer_mouse_exited():
if mouse_on_top == false: if not mouse_on_top:
return return
mouse_on_top = false mouse_on_top = false
paint_canvas.tool_layer.clear() paint_canvas.tool_layer.clear()
@ -765,7 +765,7 @@ func _on_ColorPicker_popup_closed():
############################################ ############################################
func is_position_in_canvas(pos): func is_position_in_canvas(pos):
if Rect2(paint_canvas_container_node.rect_global_position, if Rect2(paint_canvas_container_node.rect_global_position,
paint_canvas_container_node.rect_global_position + paint_canvas_container_node.rect_size).has_point(pos): paint_canvas_container_node.rect_global_position + paint_canvas_container_node.rect_size).has_point(pos):
return true return true
return false return false

View File

@ -39,7 +39,7 @@ static func to_2D(idx, w) -> Vector2:
var p = Vector2() var p = Vector2()
p.x = int(idx) % int(w) p.x = int(idx) % int(w)
p.y = int(idx / w) p.y = int(idx / w)
return p return p

View File

@ -71,8 +71,8 @@ Copyright FAQ
2. I want to package these fonts separately for distribution and 2. I want to package these fonts separately for distribution and
sale as part of a larger software package or system. Can I do so? sale as part of a larger software package or system. Can I do so?
Yes. A RPM or Debian package is a "larger software package" to begin Yes. A RPM or Debian package is a "larger software package" to begin
with, and you aren't selling them independently by themselves. with, and you aren't selling them independently by themselves.
See 1. above. See 1. above.
3. Are derivative works allowed? 3. Are derivative works allowed?
@ -91,7 +91,7 @@ Copyright FAQ
opening). You must include the Bitstream copyright. Additional opening). You must include the Bitstream copyright. Additional
copyrights can be added, as per copyright law. Happy Font Hacking! copyrights can be added, as per copyright law. Happy Font Hacking!
6. If I have improvements for Bitstream Vera, is it possible they might get 6. If I have improvements for Bitstream Vera, is it possible they might get
adopted in future versions? adopted in future versions?
Yes. The contract between the Gnome Foundation and Bitstream has Yes. The contract between the Gnome Foundation and Bitstream has
@ -110,7 +110,7 @@ Copyright FAQ
Sure. Bundle the fonts with your software and sell your software Sure. Bundle the fonts with your software and sell your software
with the fonts. That is the intent of the copyright. with the fonts. That is the intent of the copyright.
8. If applications have built the names "Bitstream Vera" into them, 8. If applications have built the names "Bitstream Vera" into them,
can I override this somehow to use fonts of my choosing? can I override this somehow to use fonts of my choosing?
This depends on exact details of the software. Most open source This depends on exact details of the software. Most open source