-
Notifications
You must be signed in to change notification settings - Fork 9
Dev stage shadow #268
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
Dev stage shadow #268
Changes from all commits
9a9ef48
b862d3d
0e5367d
66d84f4
c9a7df2
83d157c
649bd55
1888659
53f2c19
2909294
1ea94f5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| Class { | ||
| #name : #PyramidShadowColorCommand, | ||
| #superclass : #PyramidAbstractBlocCommand, | ||
| #category : #'Pyramid-Bloc-plugin-bloc-visuals' | ||
| } | ||
|
|
||
| { #category : #testing } | ||
| PyramidShadowColorCommand >> canBeUsedFor: anObject [ | ||
|
|
||
| ^ (super canBeUsedFor: anObject) and: [ | ||
| anObject effect class = BlSimpleShadowEffect or: [ | ||
| anObject effect class = BlGaussianShadowEffect ] ] | ||
| ] | ||
|
|
||
| { #category : #accessing } | ||
| PyramidShadowColorCommand >> getValueFor: aBlElement [ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. choose a protocol name |
||
|
|
||
| (aBlElement effect class = BlSimpleShadowEffect or: [ | ||
| aBlElement effect class = BlGaussianShadowEffect ]) ifFalse: [ ^ nil ]. | ||
| ^ aBlElement effect color | ||
| ] | ||
|
|
||
| { #category : #accessing } | ||
| PyramidShadowColorCommand >> setValueFor: aBlElement with: aColor [ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. bad protocol name |
||
|
|
||
| (aBlElement effect class = BlSimpleShadowEffect or: [ | ||
| aBlElement effect class = BlGaussianShadowEffect ]) ifFalse: [ ^ nil ]. | ||
| aBlElement effect: (aBlElement effect copyWithColor: aColor). | ||
| PyramidShadowCommand current syncFromElement: aBlElement | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why need this ? |
||
| ] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| Class { | ||
| #name : #PyramidShadowCommand, | ||
| #superclass : #PyramidAbstractBlocCommand, | ||
| #instVars : [ | ||
| 'lastSimpleShadow', | ||
| 'lastGaussianShadow' | ||
| ], | ||
| #classInstVars : [ | ||
| 'current' | ||
| ], | ||
| #category : #'Pyramid-Bloc-plugin-bloc-visuals' | ||
| } | ||
|
|
||
| { #category : #accessing } | ||
| PyramidShadowCommand class >> current [ | ||
| current ifNil: [ current := self new ]. | ||
| ^ current | ||
| ] | ||
|
|
||
| { #category : #accessing } | ||
| PyramidShadowCommand class >> resetShadowCommand [ | ||
|
|
||
| current := nil | ||
| ] | ||
|
|
||
| { #category : #accessing } | ||
| PyramidShadowCommand >> getValueFor: aBlElement [ | ||
|
|
||
| ^ aBlElement effect | ||
| ] | ||
|
|
||
| { #category : #accessing } | ||
| PyramidShadowCommand >> lastGaussianShadow [ | ||
| ^ lastGaussianShadow ifNil: [ BlGaussianShadowEffect color: Color black width: 2 offset: 2 @ 2 ] | ||
| ] | ||
|
|
||
| { #category : #accessing } | ||
| PyramidShadowCommand >> lastSimpleShadow [ | ||
|
|
||
| ^ lastSimpleShadow ifNil: [ | ||
| BlSimpleShadowEffect color: Color black offset: 2 @ 2 ] | ||
| ] | ||
|
|
||
| { #category : #accessing } | ||
| PyramidShadowCommand >> setValueFor: aBlElement with: anArgument [ | ||
|
|
||
| anArgument class = BlSimpleShadowEffect ifTrue: [ | ||
| lastSimpleShadow := anArgument ]. | ||
| anArgument class = BlGaussianShadowEffect ifTrue: [ | ||
| lastGaussianShadow := anArgument ]. | ||
| aBlElement effect: anArgument | ||
| ] | ||
|
|
||
| { #category : #updating } | ||
| PyramidShadowCommand >> syncFromElement: aBlElement [ | ||
|
|
||
| aBlElement effect class = BlSimpleShadowEffect ifTrue: [ | ||
| lastSimpleShadow := aBlElement effect ]. | ||
| aBlElement effect class = BlGaussianShadowEffect ifTrue: [ | ||
| lastGaussianShadow := aBlElement effect ] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same problem here: different kind of effects |
||
| ] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| Class { | ||
| #name : #PyramidShadowGaussianWidthCommand, | ||
| #superclass : #PyramidAbstractBlocCommand, | ||
| #category : #'Pyramid-Bloc-plugin-bloc-visuals' | ||
| } | ||
|
|
||
| { #category : #testing } | ||
| PyramidShadowGaussianWidthCommand >> canBeUsedFor: anObject [ | ||
|
|
||
| ^ (super canBeUsedFor: anObject) and: [ | ||
| anObject effect class = BlGaussianShadowEffect ] | ||
| ] | ||
|
|
||
| { #category : #accessing } | ||
| PyramidShadowGaussianWidthCommand >> getValueFor: aBlElement [ | ||
|
|
||
| (aBlElement effect class = BlSimpleShadowEffect or: [ | ||
| aBlElement effect class = BlGaussianShadowEffect ]) ifFalse: [ ^ nil ]. | ||
| ^ aBlElement effect width | ||
| ] | ||
|
|
||
| { #category : #accessing } | ||
| PyramidShadowGaussianWidthCommand >> setValueFor: aBlElement with: aWidth [ | ||
|
|
||
| (aBlElement effect class = BlSimpleShadowEffect or: [ | ||
| aBlElement effect class = BlGaussianShadowEffect ]) ifFalse: [ ^ nil ]. | ||
| aBlElement effect: (aBlElement effect copyWithWidth: aWidth). | ||
| PyramidShadowCommand current syncFromElement: aBlElement | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| Class { | ||
| #name : #PyramidShadowOffsetCommand, | ||
| #superclass : #PyramidAbstractBlocCommand, | ||
| #category : #'Pyramid-Bloc-plugin-bloc-visuals' | ||
| } | ||
|
|
||
| { #category : #testing } | ||
| PyramidShadowOffsetCommand >> canBeUsedFor: anObject [ | ||
|
|
||
| ^ (super canBeUsedFor: anObject) and: [ | ||
| anObject effect class = BlSimpleShadowEffect or: [anObject effect class = BlGaussianShadowEffect] ] | ||
| ] | ||
|
|
||
| { #category : #accessing } | ||
| PyramidShadowOffsetCommand >> getValueFor: aBlElement [ | ||
|
|
||
| (aBlElement effect class = BlSimpleShadowEffect or: [ | ||
| aBlElement effect class = BlGaussianShadowEffect ]) ifFalse: [ ^ nil ]. | ||
| ^ aBlElement effect offset | ||
| ] | ||
|
|
||
| { #category : #accessing } | ||
| PyramidShadowOffsetCommand >> setValueFor: aBlElement with: aPoint [ | ||
|
|
||
| (aBlElement effect class = BlSimpleShadowEffect or: [ | ||
| aBlElement effect class = BlGaussianShadowEffect ]) ifFalse: [ ^ nil ]. | ||
| aBlElement effect: (aBlElement effect copyWithOffset: aPoint). | ||
| PyramidShadowCommand current syncFromElement: aBlElement | ||
| ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why need reset ? Why use a singleton (current) ?