mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-05-06 09:04:49 -04:00
Fixed bugs detected by overloaded
One bug was that rotxel was used at the end, no matter what algorithm was chosen. The other was that rotxel was taking into account a image of width x width dimensions.
This commit is contained in:
parent
e24e9d65a5
commit
a9a647a7ee
2 changed files with 6 additions and 2 deletions
|
@ -29,7 +29,11 @@ func _on_SpinBox_value_changed(value):
|
||||||
|
|
||||||
func _on_RotateImage_confirmed():
|
func _on_RotateImage_confirmed():
|
||||||
Global.canvas.handle_undo("Draw")
|
Global.canvas.handle_undo("Draw")
|
||||||
|
match $VBoxContainer/HBoxContainer2/OptionButton.text:
|
||||||
|
"Rotxel":
|
||||||
Global.rotxel(layer,$VBoxContainer/HBoxContainer/HSlider.value*PI/180)
|
Global.rotxel(layer,$VBoxContainer/HBoxContainer/HSlider.value*PI/180)
|
||||||
|
"Nearest neighbour":
|
||||||
|
Global.nn_rotate(layer,$VBoxContainer/HBoxContainer/HSlider.value*PI/180)
|
||||||
Global.canvas.handle_redo("Draw")
|
Global.canvas.handle_redo("Draw")
|
||||||
$VBoxContainer/HBoxContainer/HSlider.value = 0
|
$VBoxContainer/HBoxContainer/HSlider.value = 0
|
||||||
|
|
||||||
|
|
|
@ -686,7 +686,7 @@ func rotxel(sprite : Image, angle : float):
|
||||||
aux.lock()
|
aux.lock()
|
||||||
sprite.lock()
|
sprite.lock()
|
||||||
for x in range(sprite.get_width()):
|
for x in range(sprite.get_width()):
|
||||||
for y in range(sprite.get_width()):
|
for y in range(sprite.get_height()):
|
||||||
var dx = 3*(x - center.x)
|
var dx = 3*(x - center.x)
|
||||||
var dy = 3*(y - center.y)
|
var dy = 3*(y - center.y)
|
||||||
var found_pixel : bool = false
|
var found_pixel : bool = false
|
||||||
|
|
Loading…
Add table
Reference in a new issue