Opened 11 years ago

Closed 11 years ago

#2184 closed defect (fixed)

OMEdit does not draw all lines in the polygon

Reported by: sjoelund.se Owned by: adeas31
Priority: high Milestone: 1.9.0
Component: OMEdit Version: trunk
Keywords: Cc:

Description

OMEdit does not draw all lines in the polygon (icon layer):

connector SignalBus "Icon for signal bus"
  annotation(Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100,-100},{100,100}}, initialScale = 0.2), graphics = {Rectangle(lineColor = {255,204,51}, lineThickness = 0.5, extent = {{-20.0,-2.0},{20.0,2.0}}),Polygon(fillColor = {255,215,136}, fillPattern = FillPattern.Solid, points = {{-80.0,50.0},{80.0,50.0},{100.0,30.0},{80.0,-40.0},{60.0,-50.0},{-60.0,-50.0},{-80.0,-40.0},{-100.0,30.0}}),Ellipse(fillPattern = FillPattern.Solid, extent = {{-65.0,15.0},{-55.0,25.0}}),Ellipse(fillPattern = FillPattern.Solid, extent = {{-5.0,15.0},{5.0,25.0}}),Ellipse(fillPattern = FillPattern.Solid, extent = {{55.0,15.0},{65.0,25.0}}),Ellipse(fillPattern = FillPattern.Solid, extent = {{-35.0,-25.0},{-25.0,-15.0}}),Ellipse(fillPattern = FillPattern.Solid, extent = {{25.0,-25.0},{35.0,-15.0}})}), Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100,-100},{100,100}}, initialScale = 0.2), graphics = {Polygon(points = {{-40,25},{40,25},{50,15},{40,-20},{30,-25},{-30,-25},{-40,-20},{-50,15},{-40,25}}, lineColor = {0,0,0}, fillColor = {255,204,51}, fillPattern = FillPattern.Solid),Ellipse(extent = {{-32.5,7.5},{-27.5,12.5}}, lineColor = {0,0,0}, fillColor = {0,0,0}, fillPattern = FillPattern.Solid),Ellipse(extent = {{-2.5,12.5},{2.5,7.5}}, lineColor = {0,0,0}, fillColor = {0,0,0}, fillPattern = FillPattern.Solid),Ellipse(extent = {{27.5,12.5},{32.5,7.5}}, lineColor = {0,0,0}, fillColor = {0,0,0}, fillPattern = FillPattern.Solid),Ellipse(extent = {{-17.5,-7.5},{-12.5,-12.5}}, lineColor = {0,0,0}, fillColor = {0,0,0}, fillPattern = FillPattern.Solid),Ellipse(extent = {{12.5,-7.5},{17.5,-12.5}}, lineColor = {0,0,0}, fillColor = {0,0,0}, fillPattern = FillPattern.Solid),Text(extent = {{-150,70},{150,40}}, lineColor = {0,0,0}, textString = "%name")}), Documentation(info = "<html>
This icon is designed for a <b>signal bus</b> connector.
</html>"));
end SignalBus;

Change History (5)

comment:1 Changed 11 years ago by adeas31

  • Resolution set to invalid
  • Status changed from new to closed

No, it does draw all the lines of the polygon. I know the polygon should be a closed shape but OMEdit show users exactly what they have written. But if you try to update the polygon it will become a closed shape :).

comment:2 Changed 11 years ago by sjoelund.se

  • Resolution invalid deleted
  • Status changed from closed to reopened

It does not work. Only the Diagram layer looks correct. The Icon layer never gets closed, and it should.
I tried moving the end point in the icon layer and it got merged with the start point. So one edge disappeared with no undo operation in OMEdit...

comment:3 Changed 11 years ago by adeas31

  • Resolution set to invalid
  • Status changed from reopened to closed

The icon layer polygon has points,

{-80.0,50.0},{80.0,50.0},{100.0,30.0},{80.0,-40.0},{60.0,-50.0},{-60.0,-50.0},{-80.0,-40.0},{-100.0,30.0}

and the diagram layer polygon has points,

{-40,25},{40,25},{50,15},{40,-20},{30,-25},{-30,-25},{-40,-20},{-50,15},{-40,25}

All the points are drawn. Wrong code will get wrong shapes. As I said OMEdit doesn't add points automatically to the shapes unless you modify them. If I add the point then people will start complaining that why OMEdit modify the model :)....

Ofcourse when you try to move the end point. The end point and the first point will get merged to make it closed polygon. Undo operation......don't know when it will be implemented!!!!

comment:4 Changed 11 years ago by sjoelund.se

  • Resolution invalid deleted
  • Status changed from closed to reopened

But...

A polygon is specified as follows:
record Polygon ... end Polygon;
The polygon is automatically closed, if the first and the last points are not identical.

You are supposed to add that extra line even if it is not there. The code is correct. It is a polygon, not a set of lines.

comment:5 Changed 11 years ago by adeas31

  • Resolution set to fixed
  • Status changed from reopened to closed

Fixed in r16074.

Note: See TracTickets for help on using tickets.