Fix inspector window zoom centering

Use floating point coordinates instead of integers to avoid rounding
errors.
This commit is contained in:
Lawrence Lee
2021-05-01 15:48:50 -07:00
parent 900af7aeb7
commit 5decec5405
2 changed files with 39 additions and 25 deletions

View File

@@ -22,7 +22,6 @@
#include "guiutils.h"
#include "../rtengine/coord.h"
#include "../rtengine/coord2d.h"
class InspectorBuffer
@@ -44,13 +43,13 @@ class Inspector final : public Gtk::DrawingArea
{
private:
rtengine::Coord center;
rtengine::Coord2D center;
std::vector<InspectorBuffer*> images;
InspectorBuffer* currImage;
bool scaled; // fit image into window
double scale; // current scale
double zoomScale, zoomScaleBegin; // scale during zoom
rtengine::Coord centerBegin, dcenterBegin; // center during zoom
rtengine::Coord2D centerBegin, dcenterBegin; // center during zoom
bool active;
bool pinned;
bool dirty;