Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1543.mcz ==================== Summary ==================== Name: Morphic-mt.1543 Author: mt Time: 26 September 2019, 11:24:13.678433 am UUID: f9c6bf1e-dc48-304e-ac71-cc10caf41ef9 Ancestors: Morphic-mt.1542 Adds a convenient way to have dashed borders for morphs. Note that this does not work for rounded corners. See Canvas. Morph new borderStyle: (DashedBorder width: 1); openInWorld. =============== Diff against Morphic-mt.1542 =============== Item was changed: ----- Method: BorderStyle class>>width:color: (in category 'instance creation') ----- width: aNumber color: aColor + "Since I am abstact, use SimpleBorder instead." + + ^ (self == BorderStyle ifTrue: [SimpleBorder] ifFalse: [self]) new + color: aColor; + width: aNumber; + yourself! - ^SimpleBorder new color: aColor; width: aNumber; yourself! Item was added: + SimpleBorder subclass: #DashedBorder + instanceVariableNames: 'dashLength gapLength gapColor offset' + classVariableNames: '' + poolDictionaries: '' + category: 'Morphic-Borders'! Item was added: + ----- Method: DashedBorder>>dashLength (in category 'accessing') ----- + dashLength + + ^ dashLength! Item was added: + ----- Method: DashedBorder>>dashLength: (in category 'accessing') ----- + dashLength: anObject + + dashLength := anObject.! Item was added: + ----- Method: DashedBorder>>frameRectangle:on: (in category 'drawing') ----- + frameRectangle: aRectangle on: aCanvas + + { + aRectangle topLeft. aRectangle topRight - (1@0). + aRectangle topRight - (1@0). aRectangle bottomRight - (1@1). + aRectangle bottomRight - (1@1). aRectangle bottomLeft - (0@1). + aRectangle bottomLeft - (0@1). aRectangle topLeft. + } pairsDo: [:startPoint :endPoint | + aCanvas + line: startPoint to: endPoint + width: self width + color: self color + dashLength: self dashLength + secondColor: self gapColor + secondDashLength: self gapLength + startingOffset: self offset]! Item was added: + ----- Method: DashedBorder>>gapColor (in category 'accessing') ----- + gapColor + + ^ gapColor! Item was added: + ----- Method: DashedBorder>>gapColor: (in category 'accessing') ----- + gapColor: anObject + + gapColor := anObject.! Item was added: + ----- Method: DashedBorder>>gapLength (in category 'accessing') ----- + gapLength + + ^ gapLength! Item was added: + ----- Method: DashedBorder>>gapLength: (in category 'accessing') ----- + gapLength: anObject + + gapLength := anObject.! Item was added: + ----- Method: DashedBorder>>initialize (in category 'initialize-release') ----- + initialize + + super initialize. + + dashLength := 10. + + gapLength := 4. + gapColor := Color transparent. + + offset := 0.! Item was added: + ----- Method: DashedBorder>>offset (in category 'accessing') ----- + offset + + ^ offset! Item was added: + ----- Method: DashedBorder>>offset: (in category 'accessing') ----- + offset: anObject + + offset := anObject.! Item was changed: ----- Method: SimpleBorder>>initialize (in category 'initialize-release') ----- initialize + + super initialize. width := 0. baseColor := color := Color transparent! |
Free forum by Nabble | Edit this page |