Opened 13 years ago

Closed 6 years ago

#683 closed enhancement (fixed)

Make d.barscale look the same on different display sizes

Reported by: perk Owned by: hamish
Priority: normal Milestone: 7.2.1
Component: Display Version: svn-trunk
Keywords: d.barscale, proportional decorations Cc: grass-dev@…
CPU: All Platform: All

Description

The current d.barscale is display dependent. The scale produced looks great on a display that's 640x480 pixels, but is unreadable on a 2400x1800 PNG display. Compare attached scalebar-default-before.png with barscale-big-after.png. This is also pretty easy to see by drawing a scalebar on an X11 display then making it full screen.

I think that the scale bar size should relative to the display size, not pixel size. I started out to fix this problem and thought it would be a relatively minor change. However, I ended up recoded a good deal of it because all of the relative sizes were hard coded and duplicated in several places.

I think I've succeeded in my main goal: the proportions of the scalebar remain the same regardless of display size. The default behavior is very much the same as before, but a little cleaner (IMO). The layout is changed slightly but is very similar to the original. The only significant layout change was the positioning of the north arrow when text is above the scale bar. It is now larger and vertically centered in the surrounding box.

I went on to add an "enlarge" option to shrink or enlarge the scalebar to get the text and north arrow just the right size by specifying an size percentage (100% = default).

Hopefully, the code is a little cleaner now, but it's still not as clean as I would like. It at least has fulfilled my immediate need.

Attachments (7)

barscale.sh (2.1 KB ) - added by perk 13 years ago.
Script to test d.scalebar (w/ spearfish) at two PNG display resolutions
barscale-default-before.png (10.9 KB ) - added by perk 13 years ago.
Output of original barscale.sh with 640x480 display
barscale-default-after.png (11.0 KB ) - added by perk 13 years ago.
Output of barscale.sh with 640x480 display with modified d.barscale
barscale-big-after.png (41.8 KB ) - added by perk 13 years ago.
Output of barscale.sh with 1920x1440 display with modified d.barscale
barscale-default-before.2.png (10.9 KB ) - added by perk 13 years ago.
Output of barscale.sh with 640x480 display with original d.barscale
barscale-big-before.png (23.1 KB ) - added by perk 13 years ago.
Output of barscale.sh with 1920x1440 display with original d.barscale
d.barscale.patch (16.1 KB ) - added by perk 13 years ago.
Patch against GRASS 6 development branch, revision 38296, 07 Jul 2009

Download all attachments as: .zip

Change History (15)

by perk, 13 years ago

Attachment: barscale.sh added

Script to test d.scalebar (w/ spearfish) at two PNG display resolutions

by perk, 13 years ago

Attachment: barscale-default-before.png added

Output of original barscale.sh with 640x480 display

by perk, 13 years ago

Attachment: barscale-default-after.png added

Output of barscale.sh with 640x480 display with modified d.barscale

by perk, 13 years ago

Attachment: barscale-big-after.png added

Output of barscale.sh with 1920x1440 display with modified d.barscale

by perk, 13 years ago

Output of barscale.sh with 640x480 display with original d.barscale

by perk, 13 years ago

Attachment: barscale-big-before.png added

Output of barscale.sh with 1920x1440 display with original d.barscale

by perk, 13 years ago

Attachment: d.barscale.patch added

Patch against GRASS 6 development branch, revision 38296, 07 Jul 2009

comment:1 by hamish, 13 years ago

Cc: grass-dev@… added
Owner: changed from grass-dev@… to hamish
Status: newassigned

comment:2 by hamish, 12 years ago

Keywords: d.barscale proportional decorations added; scalebar removed
Milestone: 6.5.07.0.0
Summary: Make d.scalebar look the same on different display sizesMake d.barscale look the same on different display sizes
Version: svn-develbranch6svn-trunk

I see your point, but this goes much deeper than just the d.barscale module, e.g. line width from d.vect exported with d.out.file and a large size= or resolution=4.

GRASS 6's display architecture is inherently pixel based, and for visual-backwards compatibility reasons I would not like to change the default behaviour there. Perhaps as a new optional flag in 6.5svn, but really I think this is much better handled first in trunk, and with the additional capability of allowing SVG/EPS symbols with with d.mark addon module (see TODO on d.graph help page) + a new d.mark flag to indicate size= is percentage of frame sqrt(height2+width+2), as is done with d.text font size.

Hamish

comment:3 by martinl, 7 years ago

Milestone: 7.0.07.0.5

comment:4 by martinl, 6 years ago

Milestone: 7.0.57.2.0

The last comment is 5 years old, what is the status of this ticket? Probably something what could be done within GSoC 2016?

in reply to:  4 ; comment:5 by annakrat, 6 years ago

Replying to martinl:

The last comment is 5 years old, what is the status of this ticket? Probably something what could be done within GSoC 2016?

I changed it in r69619. I added width_scale option to enable scaling of scale bar.

comment:6 by neteler, 6 years ago

Milestone: 7.2.07.2.1

Ticket retargeted after milestone closed

in reply to:  5 comment:7 by martinl, 6 years ago

Replying to annakrat:

Replying to martinl:

The last comment is 5 years old, what is the status of this ticket? Probably something what could be done within GSoC 2016?

I changed it in r69619. I added width_scale option to enable scaling of scale bar.

Enough to close this ticket?

comment:8 by annakrat, 6 years ago

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