Opened 13 years ago

Closed 8 years ago

#1410 closed defect (fixed)

scalebar displays multiples north arrows

Reported by: cmbarton Owned by: grass-dev@…
Priority: normal Milestone: 7.0.5
Component: Display Version: svn-trunk
Keywords: d.barscale, ll, north arrow Cc:
CPU: Unspecified Platform: All

Description

I just tried to use the scalebar in GRASS 7. Because it is a latlon map, I picked north arrow only. It displays a new line-drawing-only north arrow (no fill now), AND it displays 3 of them in a row. Only the left-most arrow has the "N" text with it. This is with both Cairo and PNG displays. I don't know if this is a problem with d.barscale or the GUI display of it. I've attached a screenshot. Weird.

Michael

Attachments (1)

multiple_northarrows.jpg (45.1 KB ) - added by cmbarton 13 years ago.

Download all attachments as: .zip

Change History (14)

by cmbarton, 13 years ago

Attachment: multiple_northarrows.jpg added

comment:1 by cmbarton, 13 years ago

Another problem is that the settings for d.barscale disappear if you turn off the north arrow and scale bar. So you have to set them again. This is not a big deal, but they used to be kept.

Michael

comment:2 by cmbarton, 13 years ago

The north arrow does not survive any screen redraw now and it turns out that settings are not kept even if you don't close it

comment:3 by cmbarton, 13 years ago

Component: DefaultDisplay
Keywords: barscale d.barscale north arrow added
Platform: UnspecifiedAll

The settings issue (above) turned out to be a wxGUI issue that is now solved. The multiple arrows only seem to appear in a latlon location and seem to be a d.barscale issue. Related to this, is the missing shading (black right triangle and white left triangle is now clear on both sides) intentional or accidental?

comment:4 by cmbarton, 12 years ago

d.barscale is still not working in latlon regions for GRASS 7. The multiple, unfilled north arrows are still being drawn. This seems to be a d.barscale problem.

comment:5 by hamish, 11 years ago

Keywords: ll added; barscale removed
  • multiples still present in lat/lon locations with grass7 for d.barscale -n.
  • infill-color for d.barscale -n doesn't seem to be working in all locations, you just get the wireframe.

Hamish

comment:6 by hamish, 11 years ago

the triplicate symbols in d.barscale still happens in lat/lon locations with the new version of the module. The infill problem is fixed now.

it seems to be during this code of D_symbol():

case S_POLYGON:
...
/* again, to draw the lines */
...
D_begin();
for (k = 0; k < chain->scount; k++) {
    xp = x0 + sx * chain->sx[k];
    yp = y0 - sy * chain->sy[k];
    if (k == 0)
	D_move_abs(xp, yp);
    else
	D_cont_abs(xp, yp);
}
D_end();
D_stroke();

which is called only once.

adding a printf() in the loop shows the xp and yp display coords look ok:

xp=50.40 yp=368.00
xp=33.40 yp=386.00
xp=50.40 yp=316.00
xp=68.40 yp=386.00
xp=50.40 yp=368.00
xp=50.40 yp=368.00

I tried throwing in a D_close() before the D_end(), no change.

  • It is unclear to me what D_end() does now, it appears to be a no-op?

trying the different north_arrow= symbol options shows the problem manifesting itself differently through a couple different scenarios. My first guess would be a missing D_stroke(), but it's right there... so my next guess is some D_move_*() or D_pos_*() function error. It's a bit unclear to me when to use D_pos_*(), I tried to add some more header comments with what I understand about them, but some clarification would be appreciated as I fear spreading misinformation.

??

thanks, Hamish

comment:7 by mlennert, 9 years ago

Duplicate of #1242 ?

comment:8 by martinl, 8 years ago

Milestone: 7.0.07.0.5

comment:9 by annakrat, 8 years ago

In 68531:

d.northarrow: fix multiplication of arrow in latlon regions, see #1242 and #1410

comment:10 by annakrat, 8 years ago

In 68531:

d.northarrow: fix multiplication of arrow in latlon regions, see #1242 and #1410

comment:11 by annakrat, 8 years ago

In 68550:

d.northarrow: fix multiplication of arrow in latlon regions, see #1242 and #1410 (merge from trunk, r68531)

comment:12 by annakrat, 8 years ago

In 68551:

d.northarrow: fix multiplication of arrow in latlon regions, see #1242 and #1410 (merge from trunk, r68531)

comment:13 by annakrat, 8 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.