Skip to content

Commit d3ff322

Browse files
authored
Remove left and right clipping (#169)
1 parent 1892130 commit d3ff322

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/ScatterplotPlugin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ void ScatterplotPlugin::selectPoints()
378378

379379
const auto width = selectionAreaImage.width();
380380
const auto height = selectionAreaImage.height();
381-
const auto size = width < height ? width : height;
381+
const auto size = std::max(width, height);//width < height ? width : height;
382382
const auto uvOffset = QPoint((selectionAreaImage.width() - size) / 2.0f, (selectionAreaImage.height() - size) / 2.0f);
383383

384384
QPointF uvNormalized = {};

src/ScatterplotWidget.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -756,8 +756,10 @@ void ScatterplotWidget::initializeGL()
756756

757757
void ScatterplotWidget::resizeGL(int w, int h)
758758
{
759-
_widgetSizeInfo.width = static_cast<float>(w);
760-
_widgetSizeInfo.height = static_cast<float>(h);
759+
const auto size = std::max(w, h);
760+
761+
_widgetSizeInfo.width = size;
762+
_widgetSizeInfo.height = size;
761763
_widgetSizeInfo.minWH = _widgetSizeInfo.width < _widgetSizeInfo.height ? _widgetSizeInfo.width : _widgetSizeInfo.height;
762764
_widgetSizeInfo.ratioWidth = _widgetSizeInfo.width / _widgetSizeInfo.minWH;
763765
_widgetSizeInfo.ratioHeight = _widgetSizeInfo.height / _widgetSizeInfo.minWH;
@@ -768,8 +770,8 @@ void ScatterplotWidget::resizeGL(int w, int h)
768770
// Pixel ratio tells us how many pixels map to a point
769771
// That is needed as macOS calculates in points and we do in pixels
770772
// On macOS high dpi displays pixel ration is 2
771-
w *= _pixelRatio;
772-
h *= _pixelRatio;
773+
//w *= _pixelRatio;
774+
//h *= _pixelRatio;
773775

774776
_pointRenderer.resize(QSize(w, h));
775777
_densityRenderer.resize(QSize(w, h));

0 commit comments

Comments
 (0)