1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 09:09:47 +00:00

Only update brush size config if size changed (#704)

This is the fix I proposed in #703 after noticing that the code in `update_config()` was being executed twice when changing the size of brushes.
This commit is contained in:
Matteo Piovanelli 2022-06-01 13:43:52 +02:00 committed by GitHub
parent 0deac041e8
commit 06d591c7ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -56,10 +56,11 @@ func _on_Brush_selected(brush: Brushes.Brush) -> void:
func _on_BrushSize_value_changed(value: float) -> void:
_brush_size = int(value)
_cache_limit = (_brush_size * _brush_size) * 3 # This equation seems the best match
update_config()
save_config()
if _brush_size != int(value):
_brush_size = int(value)
_cache_limit = (_brush_size * _brush_size) * 3 # This equation seems the best match
update_config()
save_config()
func _on_InterpolateFactor_value_changed(value: float) -> void: