summaryrefslogtreecommitdiffstats
path: root/src/display/nr-light.cpp
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2017-12-11 14:46:46 +0000
committerTavmjong Bah <tavmjong@free.fr>2017-12-11 14:46:46 +0000
commit27331112b15e81341e41a9fe276098ab4ccbe90d (patch)
treedc6faa8e885c46268558b0c9747ed5c472bf7300 /src/display/nr-light.cpp
parentPrevent snapping while space-panning (diff)
parentFix rendering of controls that don't invert color. (diff)
downloadinkscape-27331112b15e81341e41a9fe276098ab4ccbe90d.tar.gz
inkscape-27331112b15e81341e41a9fe276098ab4ccbe90d.zip
Merge branch 'hidpi_canvas'
Fixes for rendering canvas and controls on high DPI monitors.
Diffstat (limited to 'src/display/nr-light.cpp')
-rw-r--r--src/display/nr-light.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/display/nr-light.cpp b/src/display/nr-light.cpp
index 0e9a55a9f..791ae53da 100644
--- a/src/display/nr-light.cpp
+++ b/src/display/nr-light.cpp
@@ -41,11 +41,11 @@ void DistantLight::light_components(NR::Fvector &lc) {
lc[LIGHT_BLUE] = SP_RGBA32_B_U(color);
}
-PointLight::PointLight(SPFePointLight *light, guint32 lighting_color, const Geom::Affine &trans) {
+PointLight::PointLight(SPFePointLight *light, guint32 lighting_color, const Geom::Affine &trans, int device_scale) {
color = lighting_color;
- l_x = light->x;
- l_y = light->y;
- l_z = light->z;
+ l_x = light->x * device_scale;
+ l_y = light->y * device_scale;
+ l_z = light->z * device_scale;
NR::convert_coord(l_x, l_y, l_z, trans);
}
@@ -64,15 +64,15 @@ void PointLight::light_components(NR::Fvector &lc) {
lc[LIGHT_BLUE] = SP_RGBA32_B_U(color);
}
-SpotLight::SpotLight(SPFeSpotLight *light, guint32 lighting_color, const Geom::Affine &trans) {
+SpotLight::SpotLight(SPFeSpotLight *light, guint32 lighting_color, const Geom::Affine &trans, int device_scale) {
double p_x, p_y, p_z;
color = lighting_color;
- l_x = light->x;
- l_y = light->y;
- l_z = light->z;
- p_x = light->pointsAtX;
- p_y = light->pointsAtY;
- p_z = light->pointsAtZ;
+ l_x = light->x * device_scale;
+ l_y = light->y * device_scale;
+ l_z = light->z * device_scale;
+ p_x = light->pointsAtX * device_scale;
+ p_y = light->pointsAtY * device_scale;
+ p_z = light->pointsAtZ * device_scale;
cos_lca = std::cos(M_PI / 180 * light->limitingConeAngle);
speExp = light->specularExponent;
NR::convert_coord(l_x, l_y, l_z, trans);