diff --git a/src/ScatterplotPlugin.cpp b/src/ScatterplotPlugin.cpp index 1c7bab9..d6964ad 100644 --- a/src/ScatterplotPlugin.cpp +++ b/src/ScatterplotPlugin.cpp @@ -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 = {}; diff --git a/src/ScatterplotWidget.cpp b/src/ScatterplotWidget.cpp index f95a50c..37ea4a1 100644 --- a/src/ScatterplotWidget.cpp +++ b/src/ScatterplotWidget.cpp @@ -756,8 +756,10 @@ void ScatterplotWidget::initializeGL() void ScatterplotWidget::resizeGL(int w, int h) { - _widgetSizeInfo.width = static_cast(w); - _widgetSizeInfo.height = static_cast(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; @@ -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));