1
0
mirror of https://github.com/lxsang/Diya-API.git synced 2024-12-26 11:28:22 +01:00
This commit is contained in:
Dany LE 2022-08-07 18:17:07 +02:00
commit 6d7ab2dcd6
6 changed files with 23 additions and 22 deletions

View File

@ -45,7 +45,7 @@ Diya2DNode >> initialize [
vbuffer := nil. vbuffer := nil.
] ]
{ #category : #'as yet unclassified' } { #category : #accessing }
Diya2DNode >> inner: aPoint [ Diya2DNode >> inner: aPoint [
^ self boundingBox containsPoint: (self local: aPoint) ^ self boundingBox containsPoint: (self local: aPoint)
] ]
@ -57,7 +57,7 @@ Diya2DNode >> local: aPoint [
] ]
{ #category : #'as yet unclassified' } { #category : #accessing }
Diya2DNode >> recFromBuffer [ Diya2DNode >> recFromBuffer [
|maxX maxY minX minY x y| |maxX maxY minX minY x y|
maxX := minX := vbuffer at: 1. maxX := minX := vbuffer at: 1.

View File

@ -14,9 +14,9 @@ DiyaButton class >> text: string [
] ]
{ #category : #accessing } { #category : #accessing }
DiyaButton >> icon: id [ DiyaButton >> icon: ico [
label icon: id. label icon: ico.
label updateLayout. label setDirty.
] ]
{ #category : #accessing } { #category : #accessing }
@ -48,8 +48,9 @@ DiyaButton >> text: string [
] ]
{ #category : #accessing } { #category : #accessing }
DiyaButton >> updateLayout [ DiyaButton >> update [
rec extent: self extent. rec extent: self extent.
label position: 0@0. label position: 0@0.
label extent: self extent. label extent: self extent.
^true
] ]

View File

@ -79,7 +79,7 @@ DiyaLabel >> txt: anObject [
] ]
{ #category : #accessing } { #category : #accessing }
DiyaLabel >> updateLayout [ DiyaLabel >> update [
|offset isize align| |offset isize align|
offset := 0. offset := 0.
icon ifNotNil: [ icon ifNotNil: [
@ -96,5 +96,6 @@ DiyaLabel >> updateLayout [
icon ifNil: [ ^self ]. icon ifNil: [ ^self ].
"{ offset. txt extent. txt maxLineWidth. align } inspect." "{ offset. txt extent. txt maxLineWidth. align } inspect."
icon position: (align @( (self extent y - self iconSize ) >> 1)). icon position: (align @( (self extent y - self iconSize ) >> 1)).
^ true
] ]

View File

@ -89,7 +89,7 @@ DiyaNode >> initialize [
id := Random new nextInt: 1e6 id := Random new nextInt: 1e6
] ]
{ #category : #'as yet unclassified' } { #category : #accessing }
DiyaNode >> inner: aPoint [ DiyaNode >> inner: aPoint [
^ self subclassResponsibility ^ self subclassResponsibility
] ]
@ -140,7 +140,7 @@ DiyaNode >> register: aBlock to: eventName [
DiyaNode >> render [ DiyaNode >> render [
dirty ifTrue:[ dirty ifTrue:[
dirty := self update not]. dirty := self update not].
shader ifNotNil: [ self setUpShader ]. shader ifNotNil: [self setUpShader].
self draw. self draw.
children ifNil: [ ^self ]. children ifNil: [ ^self ].
children do: [:c | c render ]. children do: [:c | c render ].
@ -178,6 +178,16 @@ DiyaNode >> scale: anObject [
self updateTF. self updateTF.
] ]
{ #category : #initialization }
DiyaNode >> setClean [
dirty := false
]
{ #category : #initialization }
DiyaNode >> setDirty [
dirty := true
]
{ #category : #accessing } { #category : #accessing }
DiyaNode >> setUpShader [ DiyaNode >> setUpShader [
|mem| |mem|
@ -227,7 +237,7 @@ DiyaNode >> tf [
^ tf ^ tf
] ]
{ #category : #'as yet unclassified' } { #category : #'event handling' }
DiyaNode >> trigger: evt [ DiyaNode >> trigger: evt [
evt enable ifFalse:[^self]. evt enable ifFalse:[^self].
ehandlers at: evt mapped type ifPresent:[:handler| handler value: evt]. ehandlers at: evt mapped type ifPresent:[:handler| handler value: evt].

View File

@ -1,5 +1,5 @@
Class { Class {
#name : #DiyaTableLayout, #name : #DiyaTableLayout,
#superclass : #DiyaWidget, #superclass : #DiyaLayout,
#category : #'Diya-Widgets' #category : #'Diya-Widgets'
} }

View File

@ -43,14 +43,3 @@ DiyaWidget >> extent: size [
DiyaWidget >> initialize [ DiyaWidget >> initialize [
super initialize. super initialize.
] ]
{ #category : #accessing }
DiyaWidget >> update [
self updateLayout.
^ true
]
{ #category : #accessing }
DiyaWidget >> updateLayout [
self subclassResponsibility
]