[GRASS-dev] [GRASS GIS] #1907: ps.map does not (always) respect the drawing order of objects

GRASS GIS trac at osgeo.org
Fri Mar 15 17:32:48 PDT 2013


#1907: ps.map does not (always) respect the drawing order of objects
-------------------------------------------------------------------+--------
 Reporter:  nikosa                                                 |       Owner:  grass-dev@…              
     Type:  defect                                                 |      Status:  new                      
 Priority:  normal                                                 |   Milestone:  7.0.0                    
Component:  Ps.map                                                 |     Version:  unspecified              
 Keywords:  ps.map, border, rectangle, drawing, displaying, order  |    Platform:  Unspecified              
      Cpu:  Unspecified                                            |  
-------------------------------------------------------------------+--------
 Consider a ps.map script including a regular map frame with a visible
 border, and on top of that a custom rectangle which crosses the map's
 border.

 Expected is to see the rectangle (whether it is color-filled or not, it
 does not matter) overlapping the map's border. It seems however that
 ps.map does not respect the order of drawing first the map's border and
 second the rectangle. The border of the map (frame) is visible through the
 rectangle (color-filled or not) which means it is drawn on top of the
 rectangle even though it was instructed first.

 This can be confirmed by producing two identical, regarding the structure,
 PS maps, though with different colors. I.e.:

 Produce a PS map with a grey map border and a black-filled rectangle (with
 grey border)

 --%<---
 border
   color grey
   width 0.01i
   end

 rectangle 77% 90% 142% 14%
         fcolor 0:0:0
         color grey
         width 0.1
         end
 end
 --->%--

 and a PS map with a blue border and a green-filled rectangle:

 --%<---
 border
   color blue
   width 0.01i
   end

 rectangle 77% 90% 142% 14%
         fcolor 0:255:0
         color grey
         width 0.1
         end
 end
 --->%--

 In both cases the map's border is visible there where it is "supposed" to
 be covered by the rectangle. Comparing the two PS files, one can identify
 that the rectangle is always drawn first and the map border second.  Hand-
 crafting a PS file so as to first draw the map frame and then the
 rectangle, is a prove that it's only a matter of drawing/displaying order.
 In this test-case, editing a PS file in order to change the drawing order
 is done by changing (below shown are only the relevant bits, in the end of
 the PS file):

 --%<---
 grestore  NP
  399.7 478.2 M 706.7 478.2 LN
  706.7 135.2 LN 399.7 135.2 LN
  CP
 0.000 1.000 0.000 C
  F
 0.502 0.502 0.502 C
 0.10000000 W
  D
 0.000 0.000 1.000 C
 0.72000000 W
 36.5 72.5 507.8 522.8 B D
 showpage
 --->%--

 to

 --%<---
 grestore
 0.000 0.000 1.000 C
 0.72000000 W
 36.5 72.5 507.8 522.8 B D
 NP
  399.7 478.2 M 706.7 478.2 LN
  706.7 135.2 LN 399.7 135.2 LN
  CP
 0.000 1.000 0.000 C
  F
 0.502 0.502 0.502 C
 0.10000000 W
  D
 showpage
 --->%--

 Why does ps.map not respect the instructions order?

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/1907>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list