Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Athens does not have a way to set and get the fill rule #2782

akevalion opened this Issue Mar 10, 2019 · 1 comment


None yet
2 participants
Copy link

akevalion commented Mar 10, 2019

Steps to reproduce the issue
1 First read this
2 Download pharo7 with PharoLauncher
3 execute the next piece of code that creates a donut in athens

| surface |
surface := AthensCairoSurface extent: 300@300.
surface drawDuring: [ :canvas | | path |
	canvas pathTransform
		translateBy: 50@50.
	"canvas setFillRuleEvenOdd."
	path := canvas createPath: [ :builder |  
			moveTo: 100 @0;
			arcCenterX: 0
				centerY: 0
				radius: 50
				startAngle: 0 
				endAngle: Float pi * 2;
			moveTo: 75@0;
			arcCenterX: 0
				centerY: 0
				radius: 30
				startAngle: 0
				endAngle: Float pi * 2.
	canvas setPaint: Color blue.
	canvas drawShape: path.
surface asForm asMorph openInWindow.

4 The result is:

Expected Result:

Athens needs new methods and variables for the following classes

AthensCairoPathBuilder >> setFillRuleEvenOdd
	context setFillRuleEvenOdd
AtthensCairoCanvas >> setFillRuleEvenOdd
AtthensCairoCanvas >> setFillRule: aCairoFillRule
	^ self ffiCall: #( void cairo_set_fill_rule ( self, cairo_fill_rule_t aCairoFillRule ) )
AthensCairoDefinitions class >> initialize_cairo_fill_rule_t
AthensCairoDefinitions class>> initialize_types
	cairo_status_t := cairo_font_type_t :=  cairo_line_join_t  := cairo_line_cap_t := cairo_status_t := cairo_font_slant_t := cairo_font_weight_t := cairo_operator_t := cairo_fill_rule_t := #int.
	cairo_pattern_t := #AthensCairoPatternPaint.
	cairo_t := #AthensCairoCanvas.
	cairo_surface_t := #AthensCairoSurface .
	cairo_text_extents_t := #CairoTextExtents.

And maybe the methods and test to check this behavior


This comment has been minimized.

Copy link

Ducasse commented Mar 10, 2019

Hi milton

Send a PR. Now you should consider that Athens will be deprecated and that we plan to use Sparta and a Sparta adaptation to expose the same API than Athens to user so that they can migrate when they want.
I told to alex that it would be super cool if you could check the status of the SpartaAthensBridge and use Sparta for Roassal 3.

akevalion added a commit to akevalion/pharo that referenced this issue Mar 19, 2019

Fix: pharo-project#2782
Added to athens: set fill rule and new example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.