Opened 8 years ago

Closed 8 years ago

#3121 closed defect (fixed)

d.barscale and northarrow positioning problem when off-screen rendering

Reported by: kuszinger Owned by: grass-dev@…
Priority: normal Milestone: 7.2.0
Component: Display Version: svn-trunk
Keywords: d.northarrow, d.barscale Cc:
CPU: Unspecified Platform: Unspecified

Description

If GRASS rendering environment is set to work to file:

os.environ['GRASS_RENDER_IMMEDIATE'] = 'cairo'
os.environ['GRASS_RENDER_FILE_READ'] = 'TRUE'
os.environ['GRASS_RENDER_TRANSPARENT'] = 'TRUE'
os.environ['GRASS_RENDER_FILE_COMPRESSION'] = '0'
os.environ['GRASS_RENDER_FILE_MAPPED'] = 'TRUE'
os.environ['GRASS_RENDER_WIDTH'] = '3000'
os.environ['GRASS_RENDER_HEIGHT'] = '2000'

and rendering into a window on this area:

os.environ['GRASS_RENDER_FRAME'] = '248,1063,187,1567'

(or other sub-window)

barscale and especially northarrow displays at weird locations. Grid rendering is OK and raster legend seems to behave ok (being at ~ same percent as on screen)

It seems to be a ofset problem. There is a sample attached with several images. Rendering commands are always the same. The only difference is that if it happens to screen or file and in the second case GRASS_RENDER_FRAME is smaller (= bigger margin).

barscale rendering:

d.barscale style="full_checker" at="44.3,10.3" label="m" bgcolor="none"

northarrow:

d.northarrow style="basic_compass" at="82.6,22.4" label="E" color="139:105:20" fill_color="139:105:20"

It seems that northarrow and barscale rendered somehow without the "left margin" so there could be a kind of ofset problem in the rendering area.

I do understand that northarrow and barscale positioning percentages are for the whole screen ( = file in this case). Also when reaching the edge of GRASS_RENDER_FRAME edge is reached by this map gadgets, they are cut and not drawn outside this GRASS_RENDER_FRAME.

Positioning of raster legend should be compared to these modules to find the difference.

Detected also 7.0.4, 7.2 and 7.3 weekly snapshot versions, 7.2 named in ticket

Attachments (3)

error_attachment.jpg (135.3 KB ) - added by kuszinger 8 years ago.
Demonstration for off screen rendering "margin" - "ofset" effect
test_script.sh (1.5 KB ) - added by kuszinger 8 years ago.
test script for developers / testers - for nc_spm_08_grass7 location
offscreen-render-OK.jpg (56.5 KB ) - added by kuszinger 8 years ago.
svnversion 69103 - result OK!

Download all attachments as: .zip

Change History (11)

by kuszinger, 8 years ago

Attachment: error_attachment.jpg added

Demonstration for off screen rendering "margin" - "ofset" effect

by kuszinger, 8 years ago

Attachment: test_script.sh added

test script for developers / testers - for nc_spm_08_grass7 location

comment:1 by kuszinger, 8 years ago

I've uploaded a test script (shell, Linux). It should be run in the nc_spm_08_grass7 location. Creates two examples showing the effect. See sample_fullpage and sample_mapwindow bmp files.

comment:2 by annakrat, 8 years ago

In 69100:

d.barscale: fix layout when using frame, see #3121

in reply to:  2 comment:3 by annakrat, 8 years ago

Replying to annakrat:

In 69100:

d.barscale: fix layout when using frame, see #3121

Could you please test d.barscale in trunk? If it's ok, then we can fix the other d. commands in the same way.

comment:4 by kuszinger, 8 years ago

Tested on:

[kuszi@kuszidell trunk]$ svnversion

69103

Result: OK. See latest attachment jpg. Barscale shows the same location when running with margin or without as well.

Thanks, great.

by kuszinger, 8 years ago

Attachment: offscreen-render-OK.jpg added

svnversion 69103 - result OK!

comment:5 by annakrat, 8 years ago

In 69107:

d.northarrow: fix layout when using frame, see #3121

comment:6 by annakrat, 8 years ago

In 69108:

d.barscale/northarrow: fix layout when using frame, see #3121 (merge from trunk, r69100, r69107)

comment:7 by annakrat, 8 years ago

In 69109:

d.barscale/northarrow: fix layout when using frame, see #3121 (merge from trunk, r69100, r69107)

comment:8 by annakrat, 8 years ago

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