Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ScatterplotPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ void ScatterplotPlugin::selectPoints()

const auto width = selectionAreaImage.width();
const auto height = selectionAreaImage.height();
const auto size = width < height ? width : height;
const auto size = std::max(width, height);//width < height ? width : height;
const auto uvOffset = QPoint((selectionAreaImage.width() - size) / 2.0f, (selectionAreaImage.height() - size) / 2.0f);

QPointF uvNormalized = {};
Expand Down
10 changes: 6 additions & 4 deletions src/ScatterplotWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -756,8 +756,10 @@ void ScatterplotWidget::initializeGL()

void ScatterplotWidget::resizeGL(int w, int h)
{
_widgetSizeInfo.width = static_cast<float>(w);
_widgetSizeInfo.height = static_cast<float>(h);
const auto size = std::max(w, h);

_widgetSizeInfo.width = size;
_widgetSizeInfo.height = size;
_widgetSizeInfo.minWH = _widgetSizeInfo.width < _widgetSizeInfo.height ? _widgetSizeInfo.width : _widgetSizeInfo.height;
_widgetSizeInfo.ratioWidth = _widgetSizeInfo.width / _widgetSizeInfo.minWH;
_widgetSizeInfo.ratioHeight = _widgetSizeInfo.height / _widgetSizeInfo.minWH;
Expand All @@ -768,8 +770,8 @@ void ScatterplotWidget::resizeGL(int w, int h)
// Pixel ratio tells us how many pixels map to a point
// That is needed as macOS calculates in points and we do in pixels
// On macOS high dpi displays pixel ration is 2
w *= _pixelRatio;
h *= _pixelRatio;
//w *= _pixelRatio;
//h *= _pixelRatio;

_pointRenderer.resize(QSize(w, h));
_densityRenderer.resize(QSize(w, h));
Expand Down
Loading