Commit graph

2 commits

Author SHA1 Message Date
Mustafa Quraish
5c763e9832 LibGUI+PixelPaint: Move fit_image_to_view to AbstractZoomPanWidget
We often want to zoom and fit the content of the widget into the
visible frame (or some rect within the frame), and it makes sense to
move this functionality into the AbstractZoomPanWidget to minimize
the amount of coordinate math derived classes need to do.

This commit moves the code that implements this functionality from
`PixelPaint::ImageEditor` into `AbstractZoomPanWidget` so that we
can also use it for other applications (such as ImageViewer!)
2022-02-14 11:49:21 +01:00
Mustafa Quraish
5d7f2086b0 LibGUI: Add AbstractZoomPanWidget widget :^)
This is an abstract widget that is meant to handle all the panning /
zooming functionality so that all applications implementing it do
not have to try to do their own coordinate math.
2022-01-14 01:02:34 +01:00