fixed some null colors in tools, added icon

This commit is contained in:
cobrapitz 2020-11-11 02:56:51 +01:00
parent baf1caeb28
commit 257f44dfc6
8 changed files with 17 additions and 6 deletions

View File

@ -1,3 +1,3 @@
source_md5="47313fa4c47a9963fddd764e1ec6e4a8"
dest_md5="2ded9e7f9060e2b530aab678b135fc5b"
source_md5="d398c4d821a32ca4f03ae87d317d0b53"
dest_md5="60bce7a9e8705550897a273f75cb13c2"

View File

@ -1,5 +1,6 @@
# Godoxel (image Editor) v0.1
###### Godot Pixel Editor
###### (Godot-Pixel Image Editor)
Godoxel is an image editor for Godot, that can be used inside the editor.
@ -11,3 +12,6 @@ Godoxel is an image editor for Godot, that can be used inside the editor.
* Save/Load
* Multiple layers (can be locked/hidden)
* Tools: Pencil, lighten/darken, rectangle/line, fill, ...
---
###### For feature proposals or occuring problems, please write an issue or message me on Discord cobrapitz#2872

File diff suppressed because one or more lines are too long

View File

@ -26,6 +26,8 @@ func commit_action(canvas):
var cells = action_data.preview.cells
var colors = action_data.preview.colors
for idx in range(cells.size()):
if canvas.get_pixel_v(cells[idx]) == null:
continue
action_data.undo.cells.append(cells[idx])
action_data.undo.colors.append(canvas.get_pixel_v(cells[idx]))

View File

@ -7,6 +7,8 @@ func do_action(canvas, data: Array):
var pixels = GEUtils.get_pixels_in_line(data[0], data[1])
for pixel in pixels:
if canvas.get_pixel_v(pixel) == null:
continue
if pixel in action_data.undo.cells:
var color = GEUtils.random_color()
canvas.set_pixel_v(pixel, color)

View File

@ -26,6 +26,8 @@ func do_action(canvas, data: Array):
pixels += GEUtils.get_pixels_in_line(p + s, p + s + Vector2(-s.x, 0))
for pixel in pixels:
if canvas.get_pixel_v(pixel) == null:
continue
canvas.set_preview_pixel_v(pixel, data[2])
action_data.undo.cells.append(pixel)
action_data.undo.colors.append(canvas.get_pixel_v(pixel))

BIN
icon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 26 KiB