summaryrefslogtreecommitdiffhomepage
path: root/spline/spline-widget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'spline/spline-widget.cpp')
-rw-r--r--spline/spline-widget.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/spline/spline-widget.cpp b/spline/spline-widget.cpp
index d329d8e2..363720c8 100644
--- a/spline/spline-widget.cpp
+++ b/spline/spline-widget.cpp
@@ -260,6 +260,21 @@ void spline_widget::drawFunction()
}
}
+double spline_widget::screen_dpi() const
+{
+#ifdef _WIN32
+ return std::max(devicePixelRatioF, 1.);
+#else
+ return std::max(std::max(logicalDpiX()/(double)physicalDpiX(), devicePixelRatioF()), 1.);
+#endif
+}
+
+QSize spline_widget::minimumSizeHint() const
+{
+ const double dpi = screen_dpi();
+ return { iround(800 * dpi), iround(250 * dpi) };
+}
+
void spline_widget::paintEvent(QPaintEvent *e)
{
if (!config)