-
-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Temp eraser POC #154
base: main
Are you sure you want to change the base?
Temp eraser POC #154
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great feature! I left some comments.
enum ToolNames { | ||
BrushTool, | ||
RectangleTool, | ||
CircleTool, | ||
LineTool, | ||
EraserTool, | ||
SelectionTool, | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why this is needed. Can't you resuse the Types.Tool
enum?
|
||
# -------------------------------------------------------------------------------------------------- | ||
func _on_eraser_pressed(): | ||
_eraser_last_tool_active = _canvas._active_tool.get_class() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of doing this, you should keep an internal Tool.Types
variable in the InfiniteCanvas
class and expose a get_active_tool_type()
method. Then us this here .This way you can get rid of all the get_class()
methods and the ToolNames
enum
# ------------------------------------------------------------------------------------------------- | ||
func get_class(): return "BrushTool" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get rid of this and all other get_class
methods. See reasoning in other comment
@@ -21,6 +21,9 @@ onready var _edit_palette_dialog: EditPaletteDialog = $EditPaletteDialog | |||
|
|||
var _ui_visible := true | |||
var _player_enabled := false | |||
var _eraser_pressed_start: float | |||
var _eraser_last_tool_active | |||
var _eraser_swap_min_time: float = 400 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a constant
Hey thanks for the feedback! Sorry for the delay, I just got back from a trip I left on right after I submitted this and it went a little longer than I thought it would. I'll go over my code tonight/tomorrow and try to implement your suggestions in and get it back to you. |
Don't worry, take your time :) |
Discussion issue: #152
Pull requested for initial commit of temporary eraser function, just wanted to add it for easier code comparison then having to go to my fork