mirror of
https://github.com/wisplite/a-star-go.git
synced 2026-06-27 15:37:07 -05:00
allow zooming to minimum zoom if canvas is big enough, and make scaling a little more comfortable
This commit is contained in:
@@ -268,7 +268,7 @@ func main() {
|
|||||||
rl.InitWindow(int32(800), int32(450), "A* Visualizer")
|
rl.InitWindow(int32(800), int32(450), "A* Visualizer")
|
||||||
defer rl.CloseWindow()
|
defer rl.CloseWindow()
|
||||||
|
|
||||||
scale := rl.GetWindowScaleDPI().X
|
scale := rl.GetWindowScaleDPI().X + 0.25
|
||||||
if scale == 0 {
|
if scale == 0 {
|
||||||
scale = 2.0 // Fallback value
|
scale = 2.0 // Fallback value
|
||||||
}
|
}
|
||||||
@@ -339,7 +339,7 @@ func main() {
|
|||||||
|
|
||||||
// 2. Apply proportional zoom so wheel steps get smaller as the view zooms out.
|
// 2. Apply proportional zoom so wheel steps get smaller as the view zooms out.
|
||||||
camera.Zoom *= float32(math.Pow(1.1, float64(wheel)))
|
camera.Zoom *= float32(math.Pow(1.1, float64(wheel)))
|
||||||
if camera.Zoom < 0.01 {
|
if camera.Zoom < 0.01 && width > 2000 && height > 2000 {
|
||||||
camera.Zoom = 0.01
|
camera.Zoom = 0.01
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user