Bloc icon indicating copy to clipboard operation
Bloc copied to clipboard

border and background filling

Open rvillemeur opened this issue 1 year ago • 2 comments

As of today, we can fill BlElement background with:

  • solid color
  • radial color
  • linear color
  • bitmap.

For border, currently we can have:

  • solid color
  • radial color
  • linear color.

The Object for bitmap exist, but cannot be used for border - it needs to implement aeApplyTo:

For consistency reason, I was wondering if we should also complete bitmap support for border. This would allow to draw border like:

BlElement new
  geometry: (BlRectangleGeometry new);
  background: (Color lightGray);
  border: (BlBorder
   paint: (BlImagePatternPaint form: PolymorphSystemSettings pharoLogoForm)
   width: 30);
  size: 358 @ 119

image

to get this, you need to add

BlImagePatternPaint >> aeApplyTo: aeCanvas
	"Apply self as a border to the canvas"
	aeCanvas
		setSourceWithForm: form

and

AeCanvas >> setSourceWithForm: aForm
	cairoContext sourceSurface: (formToCairoSurfaceCache at: aForm) x: 0.0 y: 0.0

However, this doesn't include opacity on border, although opacity on element may be sufficient.

rvillemeur avatar May 15 '24 19:05 rvillemeur