Status: New
Owner: ---- Labels: Type-Defect Priority-Medium New issue 1097 by [hidden email]: Not all shapes support borderColor/borderWidth https://code.google.com/p/moose-technology/issues/detail?id=1097 Some shapes are using the default stroke and/or the default stroke width, even if the user sets a borderColor/borderWidth |v ver circle box poly es | v := RTView new. ver := (1 to:5)collect:[:i | Point r:100 degrees:(360/5*i)]. circle := RTEllipse new size: 200; color: Color red; borderWidth:5;borderColor: Color green. box := RTBox new size: 200; color: Color red; borderWidth:5;borderColor: Color green. poly := RTPolygon new size: 200; vertices:ver; color: Color red; borderWidth:5;borderColor: Color green. es := circle elementOn:'hello'. v add: es. es := box elementOn:'hello'. v add: es. es := poly elementOn:'hello'. v add: es. v @ RTDraggableView . RTGridLayout on: v elements. v "all shapes should use the provided borderWidth (5) and borderColor (Green)" moose build 3147 * Type-Defect * Component-Roassal2 Attachments: shapes.png 11.5 KB -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Comment #1 on issue 1097 by [hidden email]: Not all shapes support borderColor/borderWidth https://code.google.com/p/moose-technology/issues/detail?id=1097 Version 602 of Roassal.mcz and Trachel-AlexandreBergel.239 addresses the bug with RTPolygon. For RTEllipse, I am not sure how to fix that... -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Comment #2 on issue 1097 by [hidden email]: Not all shapes support borderColor/borderWidth https://code.google.com/p/moose-technology/issues/detail?id=1097 It is possible to draw an ellipse with a uniform scaled stroke (with cairo). Athens just don't expose this api. (there was a lenghtly discussion with no result http://forum.world.st/Athens-and-ellipse-drawing-tt4754256.html#a4765659) Here is an example for an ellipse with uniform stroke. | view | view := AthensSceneView new. view scene: [ :canvas | | stroke ellipse | canvas surface clear: Color black. canvas pathTransform restoreAfter: [ canvas pathTransform scaleBy: 1 @ 2. ellipse := canvas createPath: [ :builder | builder absolute; moveTo: 10 @ 75; ccwArcTo: 75 @ 140 angle: 90 degreesToRadians; ccwArcTo: 140 @ 75 angle: 90 degreesToRadians; ccwArcTo: 75 @ 10 angle: 90 degreesToRadians; ccwArcTo: 10 @ 75 angle: 90 degreesToRadians ]. canvas setPaint: Color blue. canvas setShape: ellipse. canvas draw. stroke := canvas setStrokePaint: Color red. stroke width: 8. "---------------- all the following uses athens-cairos PRIVATE api --------------" "load the path with the current active (scaled) matrix" canvas newPath. canvas loadPath: ellipse ]. "explicit set the (restored/identity) pathMatrix" canvas setPathMatrix. "dont call draw it would again load the path with the now active pathtransform" "just load the color and render the stroke" stroke prepareForDrawingOn: canvas. canvas stroke ]. view openInWindow. -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Comment #3 on issue 1097 by [hidden email]: Not all shapes support borderColor/borderWidth https://code.google.com/p/moose-technology/issues/detail?id=1097 borderWidth/borderColor works for polygon shapes, verified in moose build 3163 -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Comment #4 on issue 1097 by [hidden email]: Not all shapes support borderColor/borderWidth https://code.google.com/p/moose-technology/issues/detail?id=1097 borderWidth/borderColor works for polygon shapes, but RTPolygon does not initializes the stroke property therefore, methos like examplePolygons throws a MNU: MessageNotUnderstood: receiver of ""asAthensPaintOn:"" is nil -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Comment #5 on issue 1097 by [hidden email]: Not all shapes support borderColor/borderWidth https://code.google.com/p/moose-technology/issues/detail?id=1097 Is this still an issue? -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Comment #6 on issue 1097 by [hidden email]: Not all shapes support borderColor/borderWidth https://code.google.com/p/moose-technology/issues/detail?id=1097 yes, RTPolygon can not be used without explicitly setting the border color. (can I get right access to the roassal repository) For drawing ellipse with a uniform border width we need a change in athens drawing api. (we should discuss this on pharo-dev) -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Comment #7 on issue 1097 by [hidden email]: Not all shapes support borderColor/borderWidth https://code.google.com/p/moose-technology/issues/detail?id=1097 As per the linked thread, you can do it with the athens drawing API already.. ellipsisOfExtent := [:builder :anExtent | | halfX halfY | halfX := anExtent x / 2. halfY := anExtent y / 2. "We expect relative builder, and start the ellipsis at anExtent x / 2 @ 0" builder curveVia: 0@(halfY negated * 0.55) and: (0.45 * halfX)@halfY negated to: halfX@ halfY negated; curveVia: halfX* 0.55 @ 0 and: halfX@ (0.45 * halfY) to: halfX @ halfY; curveVia: 0 @ (halfY * 0.55 ) and: (0.45 * halfX negated @ halfY) to: halfX negated @ halfY; curveVia: (halfX negated * 0.55) @ 0 and: halfX negated @ (halfY negated * 0.45) to: halfX negated @ halfY negated; close]. AthensSceneView new scene: [ :can | | path | path := can createPath: [ :builder | builder moveTo: 10@60. ellipsisOfExtent value: builder value: 200@100 ]. (can setPaint: Color blue; drawShape: path; setStrokePaint: Color red) width: 8 asFloat. can drawShape: path ] ; openInWindow -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Comment #8 on issue 1097 by [hidden email]: Not all shapes support borderColor/borderWidth https://code.google.com/p/moose-technology/issues/detail?id=1097 What is indeed impossible in Athens, is drawing unscaled strokes on a scaled path, since path scaling only occurs as part of drawing, not creation. The above avoids that by using no scaling to draw the ellipse. -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Comment #9 on issue 1097 by [hidden email]: Not all shapes support borderColor/borderWidth https://code.google.com/p/moose-technology/issues/detail?id=1097 Ah thank you, I thought this kind of "ellipsis" wouldn't be like a real ellipse and would look different, but it looks quite similar (can not see any a difference). We should take this solution. I attached a changeset with the above mentioned ellipse drawing. And Polygonshapes with no border are working again. I moved the strokeWidth, and accessors and the method drawStrokeIfNecessaryOn: up to the TRShape class Attachments: issue_1097_border_for_all_shapes.cs 6.5 KB -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Free forum by Nabble | Edit this page |