[Libreoffice-commits] core.git: 2 commits - chart2/source vcl/source
Jan Holesovsky
kendy at collabora.com
Tue Apr 8 05:09:26 PDT 2014
chart2/source/view/inc/3DChartObjects.hxx | 3 ++-
vcl/source/window/window.cxx | 30 ++++++++++++++++++++----------
2 files changed, 22 insertions(+), 11 deletions(-)
New commits:
commit d06269447f8de52fd35e4e97d127279cc3f84025
Author: Jan Holesovsky <kendy at collabora.com>
Date: Tue Apr 8 12:58:51 2014 +0200
fdo#77059, hidpi: Increase the threshold of what DPI we consider hi-dpi.
Change-Id: I79802df4c11b3543140672419d78b697848b7c36
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 0596e0c..ef6e2bb 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -854,6 +854,23 @@ static bool ImplDoTiledRendering()
#endif
}
+static sal_Int32 CountDPIScaleFactor(sal_Int32 nDPI)
+{
+ sal_Int32 nResult = 1;
+
+#ifndef MACOSX
+ // Setting of HiDPI is unfortunately all only a heuristic; and to add
+ // insult to an injury, the system is constantly lying to us about
+ // the DPI and whatnot
+ // eg. fdo#77059 - set the value from which we do consider the
+ // screen hi-dpi to greater than 168
+ if (nDPI > 168)
+ nResult = std::max(sal_Int32(1), (nDPI) / 96);
+#endif
+
+ return nResult;
+}
+
void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSystemParentData )
{
DBG_ASSERT( mpWindowImpl->mbFrame || pParent, "Window::Window(): pParent == NULL" );
@@ -1108,11 +1125,8 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste
}
// setup the scale factor for Hi-DPI displays
-#ifdef MACOSX
- mnDPIScaleFactor = 1;
-#else
- mnDPIScaleFactor = std::max((sal_Int32)1, (mpWindowImpl->mpFrameData->mnDPIY + 48) / 96);
-#endif
+ mnDPIScaleFactor = CountDPIScaleFactor(mpWindowImpl->mpFrameData->mnDPIY);
+
const StyleSettings& rStyleSettings = mxSettings->GetStyleSettings();
sal_uInt16 nScreenZoom = rStyleSettings.GetScreenZoom();
mnDPIX = (mpWindowImpl->mpFrameData->mnDPIX*nScreenZoom)/100;
@@ -1810,11 +1824,7 @@ void Window::ImplInitResolutionSettings()
mnDPIY = (mpWindowImpl->mpFrameData->mnDPIY*nScreenZoom)/100;
// setup the scale factor for Hi-DPI displays
-#ifdef MACOSX
- mnDPIScaleFactor = 1;
-#else
- mnDPIScaleFactor = std::max((sal_Int32)1, (mpWindowImpl->mpFrameData->mnDPIY + 48) / 96);
-#endif
+ mnDPIScaleFactor = CountDPIScaleFactor(mpWindowImpl->mpFrameData->mnDPIY);
SetPointFont( rStyleSettings.GetAppFont() );
}
else if ( mpWindowImpl->mpParent )
commit f6406c910a60c075ca3c4928c7f451eae3ab751f
Author: Jan Holesovsky <kendy at collabora.com>
Date: Tue Apr 8 08:58:18 2014 +0200
Need 3 points to define a rectangle in 3D.
Change-Id: I47e212f922b67ced6c6cd63bf90133c024cf0af4
diff --git a/chart2/source/view/inc/3DChartObjects.hxx b/chart2/source/view/inc/3DChartObjects.hxx
index e4e3709..06121f4 100644
--- a/chart2/source/view/inc/3DChartObjects.hxx
+++ b/chart2/source/view/inc/3DChartObjects.hxx
@@ -49,6 +49,7 @@ class Text : public Renderable3DObject
private:
BitmapEx maText;
glm::vec3 maTopLeft;
+ glm::vec3 maTopRight;
glm::vec3 maBottomRight;
};
@@ -56,6 +57,7 @@ class Rectangle : public Renderable3DObject
{
private:
glm::vec3 maTopLeft;
+ glm::vec3 maTopRight;
glm::vec3 maBottomRight;
Color maColor; // RGBA fill color
Color maLineColor; // RGBA line color
@@ -66,7 +68,6 @@ class Camera : public Renderable3DObject
public:
Camera();
private:
-
glm::vec3 maPos;
glm::vec3 maDirection;
};
More information about the Libreoffice-commits
mailing list