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

PixelPaint: Inherit from AbstractZoomPanWidget

This commit is contained in:
Mustafa Quraish 2022-01-08 04:44:19 -05:00 committed by Andreas Kling
parent b21d128075
commit 7974fee800
12 changed files with 69 additions and 244 deletions

View file

@ -27,7 +27,8 @@ void ZoomTool::on_mousedown(Layer*, MouseEvent& event)
return;
auto scale_factor = (raw_event.button() == GUI::MouseButton::Primary) ? m_sensitivity : -m_sensitivity;
m_editor->scale_centered_on_position(raw_event.position(), scale_factor);
auto new_scale = AK::exp2(scale_factor);
m_editor->scale_centered(new_scale, raw_event.position());
}
GUI::Widget* ZoomTool::get_properties_widget()