On 21 December 2011 13:38, Fernando Olivero <[email protected]> wrote: > Hi Igor and Stef, > > Im NBCairo i reified CairoLineCaps, and CairoLineJoin. > > In Athens is missing, should AthensLineSegment hold this information?, > so when then canvas visits the line segment, it should change the > cairo context accordingly. > ( AthensCairoCanvas>>visitLineSegment: line)
It will be reified, but slightly different. Line caps and joins used only for path strokes, but not for fills. Paths are orthogonal to these options. While paths are built from segments (like moveto, lineto etc), they do not carry any information whether they will be used for fills or for strokes. Like that you can use same path to either stroke it or fill it. In Athens, to stoke path you should use a stoke paint object, by issuing: canvas setStrokePaint: aPaint. and then in resulting object you will be able to set different options like join type and cap style, like: paint := canvas setStrokePaint: Color blue. paint capStyle: #blah. We discussed this before deciding, where to put a difference between 'fill' and 'stroke' and decided that putting it into paint object will be more natural, and like that we don't have to blowup the canvas protocol. So, canvas to render any shape just needs to implement #drawShape: while whether to fill given shape or stroke it, decided by currently selected paint object i.e.: canvas setPaint: myPaint. canvas drawShape: anyShape. -- Best regards, Igor Stasenko.
