You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The first function receives a AeCairoPattern, an instance of this hierarchy:
in the other hand, the cairo_set_source_rgb, cairo_set_source_rgba and cairo_set_source_surface are only shortcuts that internally create a pattern but avoid creation of the patterns explicitly on lib users.
In our bindings, I added this method to simplify setting as source an instance of Color:
AeCairoContext>>sourceColor: aColor
aColor isTranslucent
ifTrue: [
selfsourceColorR: aColor red
g: aColor green
b: aColor blue
a: aColor alpha ]
ifFalse: [
selfsourceColorR: aColor red
g: aColor green
b: aColor blue ]
My point: When writing examples and tests, several times I had the intuition to type aCairoContext source: Color black instead of aCairoContext sourceColor: Color black.
This would include as well renaming current AeCairoContext>>source: as sourcePattern:, and add AeCairoPattern>>asSetAsSourceIn: that sets it when using the generic source:.
In cairo, the "source" can be a color, a gradient or a surface. The C API and our bindings are:
The first function receives a
![Screenshot 2024-12-18 at 14 14 53](https://private-user-images.githubusercontent.com/3044265/397034442-56be9a0d-7ca9-4cb9-8df6-78f7af9c12ed.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNzEwOTksIm5iZiI6MTczOTI3MDc5OSwicGF0aCI6Ii8zMDQ0MjY1LzM5NzAzNDQ0Mi01NmJlOWEwZC03Y2E5LTRjYjktOGRmNi03OGY3YWY5YzEyZWQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTFUMTA0NjM5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NTBmOTQ5YTNhMzU1OWEyOTc0N2MxMTAxOTBmN2RkOTJlNDhiOTFkODM0Y2QxZGJlZGVmYjkxYTg1YjNlMDZkNSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.kK0u5a4Rob9Dw6f0maFfZDoVCU58vER1mQBPR8c89kM)
AeCairoPattern
, an instance of this hierarchy:in the other hand, the
cairo_set_source_rgb
,cairo_set_source_rgba
andcairo_set_source_surface
are only shortcuts that internally create a pattern but avoid creation of the patterns explicitly on lib users.In our bindings, I added this method to simplify setting as source an instance of
Color
:My point: When writing examples and tests, several times I had the intuition to type
aCairoContext source: Color black
instead ofaCairoContext sourceColor: Color black
.We could provide something like:
and then:
and convert
AeCairoContext>>sourceColor:
intoColor>>aeSetAsSourceIn:
.Not sure if I like it, anyway.
👉 Please share your opinions 👈
The text was updated successfully, but these errors were encountered: