mirror of
https://github.com/lxsang/Diya-API.git
synced 2024-12-26 11:28:22 +01:00
Merge b8257f7011
This commit is contained in:
commit
6d7ab2dcd6
@ -45,7 +45,7 @@ Diya2DNode >> initialize [
|
||||
vbuffer := nil.
|
||||
]
|
||||
|
||||
{ #category : #'as yet unclassified' }
|
||||
{ #category : #accessing }
|
||||
Diya2DNode >> inner: aPoint [
|
||||
^ self boundingBox containsPoint: (self local: aPoint)
|
||||
]
|
||||
@ -57,7 +57,7 @@ Diya2DNode >> local: aPoint [
|
||||
|
||||
]
|
||||
|
||||
{ #category : #'as yet unclassified' }
|
||||
{ #category : #accessing }
|
||||
Diya2DNode >> recFromBuffer [
|
||||
|maxX maxY minX minY x y|
|
||||
maxX := minX := vbuffer at: 1.
|
||||
|
@ -14,9 +14,9 @@ DiyaButton class >> text: string [
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
DiyaButton >> icon: id [
|
||||
label icon: id.
|
||||
label updateLayout.
|
||||
DiyaButton >> icon: ico [
|
||||
label icon: ico.
|
||||
label setDirty.
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
@ -48,8 +48,9 @@ DiyaButton >> text: string [
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
DiyaButton >> updateLayout [
|
||||
DiyaButton >> update [
|
||||
rec extent: self extent.
|
||||
label position: 0@0.
|
||||
label extent: self extent.
|
||||
^true
|
||||
]
|
||||
|
@ -79,7 +79,7 @@ DiyaLabel >> txt: anObject [
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
DiyaLabel >> updateLayout [
|
||||
DiyaLabel >> update [
|
||||
|offset isize align|
|
||||
offset := 0.
|
||||
icon ifNotNil: [
|
||||
@ -96,5 +96,6 @@ DiyaLabel >> updateLayout [
|
||||
icon ifNil: [ ^self ].
|
||||
"{ offset. txt extent. txt maxLineWidth. align } inspect."
|
||||
icon position: (align @( (self extent y - self iconSize ) >> 1)).
|
||||
^ true
|
||||
|
||||
]
|
||||
|
@ -89,7 +89,7 @@ DiyaNode >> initialize [
|
||||
id := Random new nextInt: 1e6
|
||||
]
|
||||
|
||||
{ #category : #'as yet unclassified' }
|
||||
{ #category : #accessing }
|
||||
DiyaNode >> inner: aPoint [
|
||||
^ self subclassResponsibility
|
||||
]
|
||||
@ -140,7 +140,7 @@ DiyaNode >> register: aBlock to: eventName [
|
||||
DiyaNode >> render [
|
||||
dirty ifTrue:[
|
||||
dirty := self update not].
|
||||
shader ifNotNil: [ self setUpShader ].
|
||||
shader ifNotNil: [self setUpShader].
|
||||
self draw.
|
||||
children ifNil: [ ^self ].
|
||||
children do: [:c | c render ].
|
||||
@ -178,6 +178,16 @@ DiyaNode >> scale: anObject [
|
||||
self updateTF.
|
||||
]
|
||||
|
||||
{ #category : #initialization }
|
||||
DiyaNode >> setClean [
|
||||
dirty := false
|
||||
]
|
||||
|
||||
{ #category : #initialization }
|
||||
DiyaNode >> setDirty [
|
||||
dirty := true
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
DiyaNode >> setUpShader [
|
||||
|mem|
|
||||
@ -227,7 +237,7 @@ DiyaNode >> tf [
|
||||
^ tf
|
||||
]
|
||||
|
||||
{ #category : #'as yet unclassified' }
|
||||
{ #category : #'event handling' }
|
||||
DiyaNode >> trigger: evt [
|
||||
evt enable ifFalse:[^self].
|
||||
ehandlers at: evt mapped type ifPresent:[:handler| handler value: evt].
|
||||
|
@ -1,5 +1,5 @@
|
||||
Class {
|
||||
#name : #DiyaTableLayout,
|
||||
#superclass : #DiyaWidget,
|
||||
#superclass : #DiyaLayout,
|
||||
#category : #'Diya-Widgets'
|
||||
}
|
||||
|
@ -43,14 +43,3 @@ DiyaWidget >> extent: size [
|
||||
DiyaWidget >> initialize [
|
||||
super initialize.
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
DiyaWidget >> update [
|
||||
self updateLayout.
|
||||
^ true
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
DiyaWidget >> updateLayout [
|
||||
self subclassResponsibility
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user