joergreichert / spray

Automatically exported from code.google.com/p/spray
1 stars 2 forks source link

Figures on the same level are marked as one would exeed the dimensions of the other #167

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The following shape is marked with the warning: "The height of all subelements 
is bigger than max_height of the shape."

shape MyShape {
     rectangle  {
         position(x=0,y=0)
         size(width=50,height=50)
     }
     ellipse {
         position(x=50,y=50)
         size(width=50,height=150)
     }     
}

As the both figures have no common parent there should be no restriction in 
width and height (in Graphiti code these both figures may contained within a 
invisible rectangle that would receive the max dimension derived by width, 
height and position of its contained figures).

Only in the following the construct the validation would be ok, as the ellipse 
is nested inside the rectangle and thus should not exceed the dimensions of its 
containing figure:

shape MyShape2 {
     rectangle  {
         position(x=0,y=0)
         size(width=50,height=50)
         ellipse {
             position(x=5,y=5)
             size(width=50,height=50)
         }     
     }
}

If you have a look at the 
org.eclipselabs.spray.shapes.validation.ShapeJavaValidator that works with 
global variables, you see how tricky the calculation of the validation is.

Original issue reported on code.google.com by de.abg.r...@gmail.com on 2 Sep 2012 at 11:15