Fix bug where selection top-left corner was not calculated correctly

This commit is contained in:
Marcus Huderle 2018-09-22 19:20:12 -05:00
parent 6dc1e0eea3
commit 113035fa93

View file

@ -8,8 +8,11 @@ QPoint SelectablePixmapItem::getSelectionDimensions()
QPoint SelectablePixmapItem::getSelectionStart() QPoint SelectablePixmapItem::getSelectionStart()
{ {
return QPoint(this->selectionInitialX + this->selectionOffsetX, int x = this->selectionInitialX;
this->selectionInitialY + this->selectionOffsetY); int y = this->selectionInitialY;
if (this->selectionOffsetX < 0) x += this->selectionOffsetX;
if (this->selectionOffsetY < 0) y += this->selectionOffsetY;
return QPoint(x, y);
} }
void SelectablePixmapItem::select(int x, int y, int width, int height) void SelectablePixmapItem::select(int x, int y, int width, int height)