[GRASS-dev] [GRASS GIS] #3121: d.barscale and northarrow positioning problem when off-screen rendering

#3121: d.barscale and northarrow positioning problem when off-screen rendering
--------------------------------------+-------------------------
Reporter: kuszinger | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.2.0
Component: Display | Version: svn-trunk
Keywords: d.northarrow, d.barscale | CPU: Unspecified
Platform: Unspecified |
--------------------------------------+-------------------------
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

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3121&gt;
GRASS GIS <https://grass.osgeo.org>

#3121: d.barscale and northarrow positioning problem when off-screen rendering
--------------------------+--------------------------------------
  Reporter: kuszinger | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.2.0
Component: Display | Version: svn-trunk
Resolution: | Keywords: d.northarrow, d.barscale
       CPU: Unspecified | Platform: Unspecified
--------------------------+--------------------------------------
Changes (by kuszinger):

* Attachment "error_attachment.jpg" added.

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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/3121&gt;
GRASS GIS <https://grass.osgeo.org>

#3121: d.barscale and northarrow positioning problem when off-screen rendering
--------------------------+--------------------------------------
  Reporter: kuszinger | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.2.0
Component: Display | Version: svn-trunk
Resolution: | Keywords: d.northarrow, d.barscale
       CPU: Unspecified | Platform: Unspecified
--------------------------+--------------------------------------
Changes (by kuszinger):

* Attachment "test_script.sh" added.

test script for developers / testers - for nc_spm_08_grass7 location

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3121&gt;
GRASS GIS <https://grass.osgeo.org>

#3121: d.barscale and northarrow positioning problem when off-screen rendering
--------------------------+--------------------------------------
  Reporter: kuszinger | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.2.0
Component: Display | Version: svn-trunk
Resolution: | Keywords: d.northarrow, d.barscale
       CPU: Unspecified | Platform: Unspecified
--------------------------+--------------------------------------

Comment (by kuszinger):

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.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3121#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

#3121: d.barscale and northarrow positioning problem when off-screen rendering
--------------------------+--------------------------------------
  Reporter: kuszinger | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.2.0
Component: Display | Version: svn-trunk
Resolution: | Keywords: d.northarrow, d.barscale
       CPU: Unspecified | Platform: Unspecified
--------------------------+--------------------------------------

Comment (by annakrat):

In [changeset:"69100" 69100]:
{{{
#!CommitTicketReference repository="" revision="69100"
d.barscale: fix layout when using frame, see #3121
}}}

--
Ticket URL: </ticket/3121#comment:2>
GRASS GIS <https://grass.osgeo.org>

#3121: d.barscale and northarrow positioning problem when off-screen rendering
--------------------------+--------------------------------------
  Reporter: kuszinger | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.2.0
Component: Display | Version: svn-trunk
Resolution: | Keywords: d.northarrow, d.barscale
       CPU: Unspecified | Platform: Unspecified
--------------------------+--------------------------------------

Comment (by annakrat):

Replying to [comment:2 annakrat]:
> In [changeset:"69100" 69100]:
> {{{
> #!CommitTicketReference repository="" revision="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.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3121#comment:3&gt;
GRASS GIS <https://grass.osgeo.org>

#3121: d.barscale and northarrow positioning problem when off-screen rendering
--------------------------+--------------------------------------
  Reporter: kuszinger | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.2.0
Component: Display | Version: svn-trunk
Resolution: | Keywords: d.northarrow, d.barscale
       CPU: Unspecified | Platform: Unspecified
--------------------------+--------------------------------------

Comment (by kuszinger):

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.'''

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/3121#comment:4&gt;
GRASS GIS <https://grass.osgeo.org>

#3121: d.barscale and northarrow positioning problem when off-screen rendering
--------------------------+--------------------------------------
  Reporter: kuszinger | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.2.0
Component: Display | Version: svn-trunk
Resolution: | Keywords: d.northarrow, d.barscale
       CPU: Unspecified | Platform: Unspecified
--------------------------+--------------------------------------
Changes (by kuszinger):

* Attachment "offscreen-render-OK.jpg" added.

svnversion 69103 - result OK!

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3121&gt;
GRASS GIS <https://grass.osgeo.org>

#3121: d.barscale and northarrow positioning problem when off-screen rendering
--------------------------+--------------------------------------
  Reporter: kuszinger | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.2.0
Component: Display | Version: svn-trunk
Resolution: | Keywords: d.northarrow, d.barscale
       CPU: Unspecified | Platform: Unspecified
--------------------------+--------------------------------------

Comment (by annakrat):

In [changeset:"69107" 69107]:
{{{
#!CommitTicketReference repository="" revision="69107"
d.northarrow: fix layout when using frame, see #3121
}}}

--
Ticket URL: </ticket/3121#comment:5>
GRASS GIS <https://grass.osgeo.org>

#3121: d.barscale and northarrow positioning problem when off-screen rendering
--------------------------+--------------------------------------
  Reporter: kuszinger | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.2.0
Component: Display | Version: svn-trunk
Resolution: | Keywords: d.northarrow, d.barscale
       CPU: Unspecified | Platform: Unspecified
--------------------------+--------------------------------------

Comment (by annakrat):

In [changeset:"69108" 69108]:
{{{
#!CommitTicketReference repository="" revision="69108"
d.barscale/northarrow: fix layout when using frame, see #3121 (merge from
trunk, r69100, r69107)
}}}

--
Ticket URL: </ticket/3121#comment:6>
GRASS GIS <https://grass.osgeo.org>

#3121: d.barscale and northarrow positioning problem when off-screen rendering
--------------------------+--------------------------------------
  Reporter: kuszinger | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.2.0
Component: Display | Version: svn-trunk
Resolution: | Keywords: d.northarrow, d.barscale
       CPU: Unspecified | Platform: Unspecified
--------------------------+--------------------------------------

Comment (by annakrat):

In [changeset:"69109" 69109]:
{{{
#!CommitTicketReference repository="" revision="69109"
d.barscale/northarrow: fix layout when using frame, see #3121 (merge from
trunk, r69100, r69107)
}}}

--
Ticket URL: </ticket/3121#comment:7>
GRASS GIS <https://grass.osgeo.org>

#3121: d.barscale and northarrow positioning problem when off-screen rendering
--------------------------+--------------------------------------
  Reporter: kuszinger | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.2.0
Component: Display | Version: svn-trunk
Resolution: fixed | Keywords: d.northarrow, d.barscale
       CPU: Unspecified | Platform: Unspecified
--------------------------+--------------------------------------
Changes (by annakrat):

* status: new => closed
* resolution: => fixed

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3121#comment:8&gt;
GRASS GIS <https://grass.osgeo.org>