summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej Zygmanowski <sppmacd@pm.me>2021-08-24 18:26:37 +0200
committerAndreas Kling <kling@serenityos.org>2021-08-27 12:45:06 +0200
commit635130ef766536730f3c735ca797193d3ae58ef1 (patch)
treeecc3897c340878d1c6ffc0473d3d75fb5eb1d2fc
parent96dee93d3f3cf15f3d9c1eae19aec5c0e7867095 (diff)
downloadserenity-635130ef766536730f3c735ca797193d3ae58ef1.zip
PixelPaint: Make scaling exponential
This matches behaviour of other image editors, e.g GIMP. The default ZoomTool sensitivity was increased for better zooming experience :^)
-rw-r--r--Userland/Applications/PixelPaint/ImageEditor.cpp2
-rw-r--r--Userland/Applications/PixelPaint/ZoomTool.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Applications/PixelPaint/ImageEditor.cpp b/Userland/Applications/PixelPaint/ImageEditor.cpp
index 248f37a611..e9332075e2 100644
--- a/Userland/Applications/PixelPaint/ImageEditor.cpp
+++ b/Userland/Applications/PixelPaint/ImageEditor.cpp
@@ -390,7 +390,7 @@ Layer* ImageEditor::layer_at_editor_position(Gfx::IntPoint const& editor_positio
void ImageEditor::clamped_scale(float scale_delta)
{
- m_scale += scale_delta;
+ m_scale *= AK::exp2(scale_delta);
if (m_scale < 0.1f)
m_scale = 0.1f;
if (m_scale > 100.0f)
diff --git a/Userland/Applications/PixelPaint/ZoomTool.h b/Userland/Applications/PixelPaint/ZoomTool.h
index e6a7b1b3aa..5809d042a6 100644
--- a/Userland/Applications/PixelPaint/ZoomTool.h
+++ b/Userland/Applications/PixelPaint/ZoomTool.h
@@ -22,7 +22,7 @@ public:
private:
RefPtr<GUI::Widget> m_properties_widget;
- double m_sensitivity { 0.1 };
+ double m_sensitivity { 0.5 };
};
}