[etoys-dev] Etoys: MorphicExtras-kfr.8.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Jun 16 19:36:18 EDT 2010
Karl Ramberg uploaded a new version of MorphicExtras to project Etoys:
http://source.squeak.org/etoys/MorphicExtras-kfr.8.mcz
==================== Summary ====================
Name: MorphicExtras-kfr.8
Author: kfr
Time: 17 June 2010, 1:35:58 am
UUID: 58e1cd3b-a123-e940-8f74-0e2f481160c5
Ancestors: MorphicExtras-kfr.7
SQ-679
MagnifierMorph menu round is broken
=============== Diff against MorphicExtras-kfr.7 ===============
Item was changed:
----- Method: MagnifierMorph>>initialize (in category 'initialization') -----
initialize
"initialize the state of the receiver"
super initialize.
trackPointer _ true.
showPointer _ false.
magnification _ 2.
+ roundness := false.
-
self extent: 128 @ 128!
Item was changed:
----- Method: MagnifierMorph>>toggleRoundness (in category 'round view') -----
toggleRoundness
+ roundness := roundness not.
+ self fullBounds changed
+ !
- | sm w |
- w _ self world.
- self isRound
- ifTrue: [owner delete.
- w addMorph: self]
- ifFalse: [sm _ ScreeningMorph new position: self position.
- sm addMorph: self.
- sm addMorph: (EllipseMorph newBounds: self bounds).
- w addMorph: sm]!
Item was changed:
----- Method: MagnifierMorph>>isRound (in category 'round view') -----
isRound
+ ^ roundness!
- ^ owner isMemberOf: ScreeningMorph!
Item was changed:
----- Method: MagnifierMorph>>drawOn: (in category 'drawing') -----
drawOn: aCanvas
+ | stencil newForm bb |
+
- super drawOn: aCanvas. "border and fill"
aCanvas isShadowDrawing ifFalse: [
"Optimize because #magnifiedForm is expensive"
+ self isRound
+ ifTrue:[stencil := (EllipseMorph new extent: self extent; color: Color white) imageForm.
+ bb := BitBlt toForm: stencil.
+ newForm := (bb copyForm: self magnifiedForm to: 0 at 0 rule: Form and) destForm.
+ aCanvas paintImage: newForm at: self innerBounds origin ]
+ ifFalse:[super drawOn: aCanvas. "border and fill"
+ aCanvas paintImage: self magnifiedForm at: self innerBounds origin]]
+
+ !
- aCanvas paintImage: self magnifiedForm at: self innerBounds origin]!
Item was changed:
BorderedMorph subclass: #MagnifierMorph
+ instanceVariableNames: 'magnification trackPointer srcExtent showPointer roundness'
- instanceVariableNames: 'magnification trackPointer srcExtent showPointer'
classVariableNames: 'RecursionLock'
poolDictionaries: ''
category: 'MorphicExtras-Demo'!
!MagnifierMorph commentStamp: '<historical>' prior: 0!
MagnifierMorph instances are magnifying lenses that magnify the morphs below them (if grabbed or if trackPointer is false) or the area around the mouse pointer.
Instance variables:
magnification <Number> The magnification to use. If non-integer, smooths the magnified form.
trackPointer <Boolean> If set, magnifies the area around the Hand. If not, magnfies the area underneath the magnifier center.
showPointer <Boolean> If set, display a small reversed rectangle in the center of the lens. Also enables the display of Morphs in the Hand itself.
srcExtent <Rectangle> The extent of the source rectangle.
Class variables:
RecursionLock <MagnifierMorph|nil> Used to avoid infinite recursion when getting the source patch to display.!
More information about the etoys-dev
mailing list