Commit 8c58fb7b authored by claes's avatar claes

Bugfix in shadow calculation for two horizontal lines

parent b931f371
...@@ -267,6 +267,11 @@ void GrowPolyLine::calculate_shadow( glow_sShadowInfo **s, int *num, int ish, in ...@@ -267,6 +267,11 @@ void GrowPolyLine::calculate_shadow( glow_sShadowInfo **s, int *num, int ish, in
m12 = sy1 - sx1 * k12 + pos12 * ish / fabs(cos(atan(k12))); m12 = sy1 - sx1 * k12 + pos12 * ish / fabs(cos(atan(k12)));
if ( fabs( k01 - k12) < DBL_EPSILON) { if ( fabs( k01 - k12) < DBL_EPSILON) {
// Identical lines // Identical lines
if ( fabs( k01) < DBL_EPSILON) {
sp[i].x = int( sx1 + 0.5);
sp[i].y = int( m01 + 0.5);
}
else {
k12 = -k12; k12 = -k12;
m12 = sy2 - k12 * sx2; m12 = sy2 - k12 * sx2;
...@@ -276,6 +281,7 @@ void GrowPolyLine::calculate_shadow( glow_sShadowInfo **s, int *num, int ish, in ...@@ -276,6 +281,7 @@ void GrowPolyLine::calculate_shadow( glow_sShadowInfo **s, int *num, int ish, in
k12 = k01; k12 = k01;
m12 = m01; m12 = m01;
} }
}
else { else {
x = (m12 - m01)/(k01 - k12); x = (m12 - m01)/(k01 - k12);
sp[i].x = int( x + 0.5); sp[i].x = int( x + 0.5);
...@@ -1566,7 +1572,10 @@ void GrowPolyLine::export_javabean( GlowTransform *t, void *node, ...@@ -1566,7 +1572,10 @@ void GrowPolyLine::export_javabean( GlowTransform *t, void *node,
int ish = int( shadow_width / 100 * trf_scale * int ish = int( shadow_width / 100 * trf_scale *
min((x_right - x_left)*ctx->zoom_factor_x, (y_high - y_low)*ctx->zoom_factor_y) + 0.5); min((x_right - x_left)*ctx->zoom_factor_x, (y_high - y_low)*ctx->zoom_factor_y) + 0.5);
if ( ish)
calculate_shadow( &sp, &p_num, ish, 0, 0, 1); calculate_shadow( &sp, &p_num, ish, 0, 0, 1);
else
jshadow = 0;
} }
int jborder = border || !(fill || (!disable_shadow && shadow_width != 0)); int jborder = border || !(fill || (!disable_shadow && shadow_width != 0));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment