Bloc
Bloc copied to clipboard
BlCircleGeometry and BlSquareGeometry do not have the same drawing logic
Hello,
I was playing with the Geometry and discover that BlCircleGeometry and BlSquareGeometry are a bit confusing.
In both example i create a rectangle shape (size := 200 @ 20) and put square and circle geometry inside. We can see that the square element is drawn in the middle of it's bound while the circle geometry is drawn on the left side.
example with square
BlElement new
background: (BlPaintBackground new
paint: (BlColorPaint new
color: (Color r: 0.844574780058651 g: 0.3841642228739003 b: 0.6852394916911045 alpha: 1.0);
yourself);
opacity: 1.0;
yourself);
clipChildren: false;
constraintsDo: [:constraints | constraints horizontal exact: 200.0.
constraints vertical exact: 200.0 ];
layout: BlFrameLayout new;
addChildren: {(BlElement new
background: (BlPaintBackground new
paint: (BlColorPaint new
color: (Color r: 0.9110459433040078 g: 0.8836754643206256 b: 0.16911045943304007 alpha: 1.0);
yourself);
opacity: 1.0;
yourself);
border: (BlBorderBuilder new
paint: (BlColorPaint new
color: (Color r: 0.0 g: 0.0 b: 0.0 alpha: 1.0);
yourself);
build);
geometry: BlSquareGeometry new;
constraintsDo: [:constraints | constraints horizontal exact: 200.0.
constraints vertical exact: 20.0.
constraints frame horizontal alignCenter.
constraints frame vertical alignCenter ];
id: #A;
yourself)};
id: #group;
openInNewSpace
example with circle
BlElement new
background: (BlPaintBackground new
paint: (BlColorPaint new
color: (Color r: 0.844574780058651 g: 0.3841642228739003 b: 0.6852394916911045 alpha: 1.0);
yourself);
opacity: 1.0;
yourself);
clipChildren: false;
constraintsDo: [:constraints | constraints horizontal exact: 200.0.
constraints vertical exact: 200.0 ];
layout: BlFrameLayout new;
addChildren: {(BlElement new
background: (BlPaintBackground new
paint: (BlColorPaint new
color: (Color r: 0.9110459433040078 g: 0.8836754643206256 b: 0.16911045943304007 alpha: 1.0);
yourself);
opacity: 1.0;
yourself);
border: (BlBorderBuilder new
paint: (BlColorPaint new
color: (Color r: 0.0 g: 0.0 b: 0.0 alpha: 1.0);
yourself);
build);
geometry: BlCircleGeometry new;
constraintsDo: [:constraints | constraints horizontal exact: 200.0.
constraints vertical exact: 20.0.
constraints frame horizontal alignCenter.
constraints frame vertical alignCenter ];
id: #A;
yourself)};
id: #group;
openInNewSpace