[Pharo-dev] [bloc] shape size?
alex.syrel at gmail.com
Sat Apr 2 18:46:46 EDT 2016
I'm pretty sure we don't understand a meaning of composition identically.
This is how I understand it:
"In graphic design for press and desktop publishing composition is commonly
referred to as page layout."
Design for press is inspiration of modern ui design techniques, for example
Concentrate on "page layout". Then comes the following question: if
composition is archived through layout of elements why Stef tries to
manually draw shapes instead of composing two elements?
1) Create an element with rectangle shape.
2) Create an element with circle shape.
3) Add circle element to rectangle element.
4) Change layout params of the circle element to match parent both
vertically and horizontally
5) if needed set padding/margin.
There is even no need to care about drawing if it's complicated.
On Apr 3, 2016 12:26 AM, "Tudor Girba" <tudor at tudorgirba.com> wrote:
> Hi Alex,
> I think that Stef is looking for a composition example. Could you please
> provide an example that is more canonical and shows the composition of two
> elements instead of playing with both drawOnSpartaCanvas and the shape?
> > On Apr 2, 2016, at 8:17 PM, Aliaksei Syrel <alex.syrel at gmail.com> wrote:
> > How to make square element with filled circle inside:
> > 1) Subclass BlElement -> BlCell
> > 2) Override
> > drawOnSpartaCanvas: aCanvas
> > super drawOnSpartaCanvas: aCanvas.
> > aCanvas
> > setShape: self localBounds;
> > setStrokePaint: Color blue;
> > stroke
> > 3) Override initialize to have circle shape:
> > initialize
> > super initialize.
> > self shapeDo: [ :aShape | aShape
> > path: BlCirclePath new;
> > fillPaint: Color red ].
> > 4) Open cell in word
> > Easy :)
> "We can create beautiful models in a vacuum.
> But, to get them effective we have to deal with the inconvenience of
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pharo-dev