-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #510 from pharo-graphics/493-Need-to-draw-a-border…
…-to-a-BlRopedTExt Add border text attribute and fix #514
- Loading branch information
Showing
14 changed files
with
256 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
Extension { #name : #BlTextBorderAttribute } | ||
|
||
{ #category : #'*Bloc-Alexandrie' } | ||
BlTextBorderAttribute >> aeDrawAboveOn: aeCanvas span: aBASpan [ | ||
|
||
isAbove ifFalse: [ ^ self ]. | ||
self aeDrawOn: aeCanvas span: aBASpan | ||
] | ||
|
||
{ #category : #'*Bloc-Alexandrie' } | ||
BlTextBorderAttribute >> aeDrawBelowOn: aeCanvas span: aBASpan [ | ||
|
||
isAbove ifTrue: [ ^ self ]. | ||
self aeDrawOn: aeCanvas span: aBASpan | ||
] | ||
|
||
{ #category : #'*Bloc-Alexandrie' } | ||
BlTextBorderAttribute >> aeDrawOn: aeCanvas span: aBASpan [ | ||
|
||
aeCanvas | ||
restoreContextAfterPaintAlpha: border opacity | ||
with: [ | ||
aeCanvas pathFactory: [ :cairoContext | | ||
aBASpan appendPathOn: aeCanvas ]. | ||
|
||
aeCanvas setBackgroundOff. | ||
aeCanvas setOutskirtsCentered. | ||
aeCanvas setBorderBlock: [ | ||
border paint aeApplyTo: aeCanvas. | ||
|
||
border style dashArray ifNotEmpty: [ :da | | ||
aeCanvas | ||
setDashes: da | ||
offset: border style dashOffset ]. | ||
|
||
border style lineJoin | ||
aeApplyTo: aeCanvas | ||
style: border style. | ||
|
||
border style lineCap aeApplyTo: aeCanvas. | ||
|
||
aeCanvas setBorderWidth: border width ]. | ||
|
||
aeCanvas drawFigure ] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
Class { | ||
#name : #BlTextBorderAttribute, | ||
#superclass : #BlTextAttribute, | ||
#instVars : [ | ||
'border', | ||
'isAbove' | ||
], | ||
#category : #'Bloc-Text-Text-Attributes' | ||
} | ||
|
||
{ #category : #'instance creation' } | ||
BlTextBorderAttribute class >> border: aBlBorder above: aBoolean [ | ||
|
||
^ self new | ||
border: aBlBorder; | ||
above: aBoolean; | ||
yourself | ||
] | ||
|
||
{ #category : #testing } | ||
BlTextBorderAttribute >> above: aBoolean [ | ||
|
||
isAbove := aBoolean | ||
] | ||
|
||
{ #category : #accessing } | ||
BlTextBorderAttribute >> border [ | ||
|
||
^ border | ||
] | ||
|
||
{ #category : #accessing } | ||
BlTextBorderAttribute >> border: aBlBorder [ | ||
|
||
border := aBlBorder | ||
] | ||
|
||
{ #category : #comparing } | ||
BlTextBorderAttribute >> equals: anotherAttribute [ | ||
|
||
^ border = anotherAttribute border and: [ isAbove = anotherAttribute isAbove ] | ||
] | ||
|
||
{ #category : #initialization } | ||
BlTextBorderAttribute >> initialize [ | ||
|
||
super initialize. | ||
|
||
isAbove := false | ||
] | ||
|
||
{ #category : #testing } | ||
BlTextBorderAttribute >> isAbove [ | ||
|
||
^ isAbove | ||
] | ||
|
||
{ #category : #printing } | ||
BlTextBorderAttribute >> printOn: aStream [ | ||
|
||
aStream nextPutAll: (isAbove | ||
ifTrue: [ 'border-above: ' ] | ||
ifFalse: [ 'border-below: ' ]). | ||
|
||
aStream print: border | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.