1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 08:37:45 +00:00

PixelPaint: Make scaling exponential

This matches behaviour of other image editors, e.g GIMP.
The default ZoomTool sensitivity was increased for better zooming
experience :^)
This commit is contained in:
Maciej Zygmanowski 2021-08-24 18:26:37 +02:00 committed by Andreas Kling
parent 96dee93d3f
commit 635130ef76
2 changed files with 2 additions and 2 deletions

View file

@ -390,7 +390,7 @@ Layer* ImageEditor::layer_at_editor_position(Gfx::IntPoint const& editor_positio
void ImageEditor::clamped_scale(float scale_delta) void ImageEditor::clamped_scale(float scale_delta)
{ {
m_scale += scale_delta; m_scale *= AK::exp2(scale_delta);
if (m_scale < 0.1f) if (m_scale < 0.1f)
m_scale = 0.1f; m_scale = 0.1f;
if (m_scale > 100.0f) if (m_scale > 100.0f)

View file

@ -22,7 +22,7 @@ public:
private: private:
RefPtr<GUI::Widget> m_properties_widget; RefPtr<GUI::Widget> m_properties_widget;
double m_sensitivity { 0.1 }; double m_sensitivity { 0.5 };
}; };
} }