commit 9c43747cc9d50a4ccb8d3ada651596b71a2862c9
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Thu Dec 3 10:07:52 2015 +0100

    Make text margin size dependent on zoom and dpi
    
    The default hardcoded value of 10 corresponds to 2.5mm at 100dpi, but does 
not make much sense on a HiDpi screen.

diff --git a/src/BufferView.cpp b/src/BufferView.cpp
index e237a63..15dcb92 100644
--- a/src/BufferView.cpp
+++ b/src/BufferView.cpp
@@ -351,11 +351,12 @@ BufferView::~BufferView()
 
 int BufferView::rightMargin() const
 {
+       // The value used to be hardcoded to 10, which is 2.5mm at 100dpi
+       int const default_margin = Length(2.5, Length::MM).inPixels(0);
        // The additional test for the case the outliner is opened.
-       if (!full_screen_ ||
-               !lyxrc.full_screen_limit ||
-               width_ < lyxrc.full_screen_width + 20)
-                       return 10;
+       if (!full_screen_ || !lyxrc.full_screen_limit
+           || width_ < lyxrc.full_screen_width + 2 * default_margin)
+               return default_margin;
 
        return (width_ - lyxrc.full_screen_width) / 2;
 }

Reply via email to