Opened 16 years ago
Closed 8 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)
Change History (15)
by , 16 years ago
Attachment: | barscale.sh added |
---|
by , 16 years ago
Attachment: | barscale-default-before.png added |
---|
Output of original barscale.sh with 640x480 display
by , 16 years ago
Attachment: | barscale-default-after.png added |
---|
Output of barscale.sh with 640x480 display with modified d.barscale
by , 16 years ago
Attachment: | barscale-big-after.png added |
---|
Output of barscale.sh with 1920x1440 display with modified d.barscale
by , 16 years ago
Attachment: | barscale-default-before.2.png added |
---|
Output of barscale.sh with 640x480 display with original d.barscale
by , 16 years ago
Attachment: | barscale-big-before.png added |
---|
Output of barscale.sh with 1920x1440 display with original d.barscale
by , 16 years ago
Attachment: | d.barscale.patch added |
---|
Patch against GRASS 6 development branch, revision 38296, 07 Jul 2009
comment:1 by , 16 years ago
Cc: | added |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:2 by , 14 years ago
Keywords: | d.barscale proportional decorations added; scalebar removed |
---|---|
Milestone: | 6.5.0 → 7.0.0 |
Summary: | Make d.scalebar look the same on different display sizes → Make d.barscale look the same on different display sizes |
Version: | svn-develbranch6 → svn-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 , 9 years ago
Milestone: | 7.0.0 → 7.0.5 |
---|
follow-up: 5 comment:4 by , 9 years ago
Milestone: | 7.0.5 → 7.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?
follow-up: 7 comment:5 by , 8 years ago
comment:7 by , 8 years ago
comment:8 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Script to test d.scalebar (w/ spearfish) at two PNG display resolutions