diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2017-12-12 21:53:22 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2017-12-12 21:53:22 +0000 |
| commit | cfecf64d6adad14f73f9c169b181ec59bf54c8f3 (patch) | |
| tree | d976a56df96484ab7d4efe1565c372218db6fdae /src/display/nr-light.cpp | |
| parent | Moving tolerance (diff) | |
| parent | Name a few more widgets. (diff) | |
| download | inkscape-cfecf64d6adad14f73f9c169b181ec59bf54c8f3.tar.gz inkscape-cfecf64d6adad14f73f9c169b181ec59bf54c8f3.zip | |
Merge branch 'master' into powerpencilII
Diffstat (limited to 'src/display/nr-light.cpp')
| -rw-r--r-- | src/display/nr-light.cpp | 22 |
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); |
