mirror of
https://github.com/lxsang/Diya-API.git
synced 2024-12-27 03:48:21 +01:00
Add bootstrap font icons support
This commit is contained in:
parent
ac764da076
commit
eba462b9c0
@ -18,6 +18,11 @@ DiyaBaseObject >> logError: string [
|
|||||||
self stderr nextPutAll: string; cr
|
self stderr nextPutAll: string; cr
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #asserting }
|
||||||
|
DiyaBaseObject >> shouldNotBeCalled [
|
||||||
|
^DiyaCoreAPIError signal: 'Should not be called'
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
DiyaBaseObject >> stderr [
|
DiyaBaseObject >> stderr [
|
||||||
^VTermOutputDriver stderr
|
^VTermOutputDriver stderr
|
||||||
|
@ -47,9 +47,7 @@ DiyaBoot >> bindGlobalEventTo: aNode [
|
|||||||
pointer borderWidth: 3."
|
pointer borderWidth: 3."
|
||||||
aNode on: #keydown do:[:e| Transcript show: 'keydown...';cr. running := false.].
|
aNode on: #keydown do:[:e| Transcript show: 'keydown...';cr. running := false.].
|
||||||
aNode on: #quit do: [:e| running := false].
|
aNode on: #quit do: [:e| running := false].
|
||||||
aNode on: #fingerdown do:[:e| self setCursorPosition: e mapped ].
|
aNode on: #(fingerdown fingermotion mousemotion) do:[:e|
|
||||||
aNode on: #fingermotion do:[:e| self setCursorPosition: e mapped ].
|
|
||||||
aNode on: #mousemotion do:[:e|
|
|
||||||
pointer position: e mapped worldPosition.
|
pointer position: e mapped worldPosition.
|
||||||
DiyaRendererContext uniqueInstance mouse: (e mapped x) @ (e mapped y).
|
DiyaRendererContext uniqueInstance mouse: (e mapped x) @ (e mapped y).
|
||||||
].
|
].
|
||||||
@ -91,10 +89,10 @@ DiyaBoot >> createWindow [
|
|||||||
|
|
||||||
{ #category : #events }
|
{ #category : #events }
|
||||||
DiyaBoot >> exampleNodes: tree [
|
DiyaBoot >> exampleNodes: tree [
|
||||||
|root node node1 ell tex txtNode|
|
|root node node1 ell tex txtNode icon|
|
||||||
root := tree addNode: (Diya2DNode new) at: 0@10.
|
root := tree addNode: (Diya2DNode new) at: 0@10.
|
||||||
tex := (DiyaImageTex fromFile:Smalltalk imageDirectory / 'assets'/'mrsang.png').
|
tex := (DiyaImageTex fromFile:Smalltalk imageDirectory / 'assets'/'mrsang.png').
|
||||||
txtNode := root addNode: (DiyaText data: 'Event') at: 10@50.
|
txtNode := root addNode: (DiyaText data: 'Event') at: 10@55.
|
||||||
txtNode color: Color orange.
|
txtNode color: Color orange.
|
||||||
txtNode extent: 200@40.
|
txtNode extent: 200@40.
|
||||||
|
|
||||||
@ -102,7 +100,7 @@ DiyaBoot >> exampleNodes: tree [
|
|||||||
node1 rotation: (Float pi / 8.0).
|
node1 rotation: (Float pi / 8.0).
|
||||||
node1 scale: 1.2@1.2.
|
node1 scale: 1.2@1.2.
|
||||||
node1 on: #mousebuttondown do:[:e| txtNode data: 'Mouse ', (node1 local: e mapped worldPosition) asIntegerPoint asString].
|
node1 on: #mousebuttondown do:[:e| txtNode data: 'Mouse ', (node1 local: e mapped worldPosition) asIntegerPoint asString].
|
||||||
node1 on: #fingerdown do:[:e| Transcript show:'finger down on image'; cr].
|
node1 on: #fingerdown do:[:e| txtNode data: 'Mouse ', (node1 local: e mapped worldPosition) asIntegerPoint asString].
|
||||||
|
|
||||||
node := root addNode: (DiyaRectangle size: 200@200) at: 250 @ 430.
|
node := root addNode: (DiyaRectangle size: 200@200) at: 250 @ 430.
|
||||||
node texture: tex.
|
node texture: tex.
|
||||||
@ -121,7 +119,7 @@ DiyaBoot >> exampleNodes: tree [
|
|||||||
|
|
||||||
|
|
||||||
node := root addNode: (DiyaText data: String loremIpsum) at: 10@400.
|
node := root addNode: (DiyaText data: String loremIpsum) at: 10@400.
|
||||||
node extent: 250@320.
|
node extent: 240@320.
|
||||||
node wordWrap: true.
|
node wordWrap: true.
|
||||||
|
|
||||||
node := root addNode: (DiyaLine from: 10@620 to: 200@635).
|
node := root addNode: (DiyaLine from: 10@620 to: 200@635).
|
||||||
@ -137,7 +135,7 @@ DiyaBoot >> exampleNodes: tree [
|
|||||||
"node rotation: Float pi / 2.0."
|
"node rotation: Float pi / 2.0."
|
||||||
ell texture: tex.
|
ell texture: tex.
|
||||||
ell on: #mousebuttondown do:[:e| txtNode data: 'Ellipse clicked', (ell local:e mapped worldPosition) asIntegerPoint asString].
|
ell on: #mousebuttondown do:[:e| txtNode data: 'Ellipse clicked', (ell local:e mapped worldPosition) asIntegerPoint asString].
|
||||||
ell on: #fingerdown do:[:e| Transcript show:'finger down on ellipse'; cr].
|
ell on: #fingerdown do:[:e| txtNode data: 'Ellipse clicked', (ell local:e mapped worldPosition) asIntegerPoint asString].
|
||||||
|
|
||||||
|
|
||||||
node := root addNode: (DiyaConvexPolygon points:{250@100. 400@250. 450@80. 350@60}).
|
node := root addNode: (DiyaConvexPolygon points:{250@100. 400@250. 450@80. 350@60}).
|
||||||
@ -146,6 +144,9 @@ DiyaBoot >> exampleNodes: tree [
|
|||||||
node texture: tex.
|
node texture: tex.
|
||||||
node borderWidth: 3.0.
|
node borderWidth: 3.0.
|
||||||
|
|
||||||
|
icon := root addNode: (DiyaFontIcon data: #(16rF101 16rF155 16rF185 16rF21B 16rF298 16rF254)) at: 10@10.
|
||||||
|
icon fontSize: 24.
|
||||||
|
icon color: (Color r: 209/255 g: 66/255 b:245/255 ).
|
||||||
^ root
|
^ root
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -38,6 +38,11 @@ DiyaEllipse >> drawBorder [
|
|||||||
"do nothing"
|
"do nothing"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #initialization }
|
||||||
|
DiyaEllipse >> drawLines [
|
||||||
|
self shouldNotBeCalled
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #initialization }
|
{ #category : #initialization }
|
||||||
DiyaEllipse >> initialize [
|
DiyaEllipse >> initialize [
|
||||||
super initialize.
|
super initialize.
|
||||||
|
58
Diya/DiyaFontIcon.class.st
Normal file
58
Diya/DiyaFontIcon.class.st
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
Class {
|
||||||
|
#name : #DiyaFontIcon,
|
||||||
|
#superclass : #DiyaText,
|
||||||
|
#pools : [
|
||||||
|
'FT2Types'
|
||||||
|
],
|
||||||
|
#category : #'Diya-Graphics'
|
||||||
|
}
|
||||||
|
|
||||||
|
{ #category : #initialization }
|
||||||
|
DiyaFontIcon >> data: code [
|
||||||
|
super data:(code isArray ifTrue: [ code ] ifFalse:[{code}]).
|
||||||
|
bbox := Rectangle origin: 0@0 corner: ((data size) * (self fontSize) ) @ self fontSize.
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #initialization }
|
||||||
|
DiyaFontIcon >> drawText [
|
||||||
|
|index offset tex|
|
||||||
|
index := 1.
|
||||||
|
tex := self texture.
|
||||||
|
offset := 0@(self fontSize).
|
||||||
|
1 to: data size do: [ :i|
|
||||||
|
(self getCharsVerticesAt:i offset: offset on: tex) do: [
|
||||||
|
:e| vbuffer at: index put:e.
|
||||||
|
index := index + 1
|
||||||
|
].
|
||||||
|
"offset setX: offset x + tex spacing setY: offset y"
|
||||||
|
].
|
||||||
|
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #initialization }
|
||||||
|
DiyaFontIcon >> fontName: name style: face size: size [
|
||||||
|
super fontName: name style:face size: size.
|
||||||
|
data ifNil: [ ^ self ].
|
||||||
|
bbox := Rectangle origin: 0@0 corner: ((data size) * (self fontSize) ) @ self fontSize.
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #initialization }
|
||||||
|
DiyaFontIcon >> getLinebreakIndices: delta [
|
||||||
|
self shouldNotBeCalled
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #initialization }
|
||||||
|
DiyaFontIcon >> initialize [
|
||||||
|
super initialize.
|
||||||
|
data := { }.
|
||||||
|
self fontName: 'bootstrap-icons' style: 'Regular' size: 16.
|
||||||
|
vbuffer := FFIExternalArray externalNewType: GLfloat size:24.
|
||||||
|
vbuffer autoRelease.
|
||||||
|
style := DiyaFontManager uniqueInstance defaultIconSet.
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #initialization }
|
||||||
|
DiyaFontIcon >> lastSeparatorFrom: i [
|
||||||
|
self shouldNotBeCalled
|
||||||
|
]
|
@ -25,6 +25,18 @@ DiyaFontManager >> defaultFamily [
|
|||||||
^'Ubuntu'
|
^'Ubuntu'
|
||||||
|
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #initialization }
|
||||||
|
DiyaFontManager >> defaultIconSet [
|
||||||
|
^ self style: 'Regular' from: 'bootstrap-icons'
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #initialization }
|
||||||
|
DiyaFontManager >> defaultStyle [
|
||||||
|
^'Regular'
|
||||||
|
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
@ -97,7 +109,7 @@ DiyaFontManager >> reset [
|
|||||||
{ #category : #initialization }
|
{ #category : #initialization }
|
||||||
DiyaFontManager >> style: styleName from: familyName [
|
DiyaFontManager >> style: styleName from: familyName [
|
||||||
|family|
|
|family|
|
||||||
family := families at: familyName ifAbsent: [ self defaultFamily ].
|
family := families at: familyName ifAbsent: [ families at: self defaultFamily ].
|
||||||
^family style: styleName
|
^family style: styleName
|
||||||
|
|
||||||
]
|
]
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
Class {
|
|
||||||
#name : #DiyaIcon,
|
|
||||||
#superclass : #DiyaImageView,
|
|
||||||
#category : #'Diya-Widgets'
|
|
||||||
}
|
|
@ -53,6 +53,11 @@ DiyaLine >> drawBorder [
|
|||||||
"do nothing"
|
"do nothing"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #initialization }
|
||||||
|
DiyaLine >> drawLines [
|
||||||
|
self shouldNotBeCalled
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
DiyaLine >> from [
|
DiyaLine >> from [
|
||||||
^ from
|
^ from
|
||||||
|
@ -86,10 +86,8 @@ DiyaNode >> isRoot [
|
|||||||
|
|
||||||
{ #category : #convenience }
|
{ #category : #convenience }
|
||||||
DiyaNode >> on: eventName do: aBlock [
|
DiyaNode >> on: eventName do: aBlock [
|
||||||
|evtCode|
|
eventName isArray ifFalse:[ ^ self register: aBlock to: eventName ].
|
||||||
evtCode := SDL2Constants bindingOf: ('SDL_', eventName asUppercase).
|
eventName do:[:e| self register: aBlock to:e ].
|
||||||
evtCode ifNil: [ ^DiyaCoreAPIError signal: 'Unknow event ', eventName ].
|
|
||||||
ehandlers at: evtCode value put: aBlock.
|
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -114,6 +112,15 @@ DiyaNode >> position: anObject [
|
|||||||
self updateTF.
|
self updateTF.
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #convenience }
|
||||||
|
DiyaNode >> register: aBlock to: eventName [
|
||||||
|
|evtCode|
|
||||||
|
evtCode := SDL2Constants bindingOf: ('SDL_', eventName asUppercase).
|
||||||
|
evtCode ifNil: [ ^DiyaCoreAPIError signal: 'Unknow event ', eventName ].
|
||||||
|
ehandlers at: evtCode value put: aBlock.
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
DiyaNode >> render [
|
DiyaNode >> render [
|
||||||
dirty ifTrue:[dirty := self update not].
|
dirty ifTrue:[dirty := self update not].
|
||||||
|
@ -39,14 +39,21 @@ DiyaText >> data: anObject [
|
|||||||
|
|
||||||
{ #category : #initialization }
|
{ #category : #initialization }
|
||||||
DiyaText >> drawBorder [
|
DiyaText >> drawBorder [
|
||||||
|
self shouldNotBeCalled
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #initialization }
|
||||||
|
DiyaText >> drawLines [
|
||||||
|
^ self shouldNotBeCalled
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
DiyaText >> drawText [
|
DiyaText >> drawText [
|
||||||
|vertices index tex2D offset|
|
|vertices index tex2D offset lbdelta|
|
||||||
index := 1.
|
index := 1.
|
||||||
offset := 0@0.
|
offset := 0@0.
|
||||||
tex2D := self texture.
|
tex2D := self texture.
|
||||||
|
lbdelta := self getLinebreakIndices: (self extent x / tex2D meanww) asInteger.
|
||||||
1 to: data size do: [ :i|
|
1 to: data size do: [ :i|
|
||||||
vertices := self getCharsVerticesAt:i offset: offset on: tex2D.
|
vertices := self getCharsVerticesAt:i offset: offset on: tex2D.
|
||||||
vertices do: [
|
vertices do: [
|
||||||
@ -54,7 +61,10 @@ DiyaText >> drawText [
|
|||||||
index := index + 1.
|
index := index + 1.
|
||||||
].
|
].
|
||||||
(offset x > self extent x and: wrap not) ifTrue: [ ^self ].
|
(offset x > self extent x and: wrap not) ifTrue: [ ^self ].
|
||||||
(offset y negated > self extent y) ifTrue: [ ^self ].
|
((lbdelta includes: i + 1) and: wrap) ifTrue: [
|
||||||
|
offset setX: 0.0 setY: (offset y )- (tex2D linespace).
|
||||||
|
(offset y negated > self extent y) ifTrue: [ ^self ].
|
||||||
|
].
|
||||||
].
|
].
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -71,8 +81,12 @@ DiyaText >> fontName [
|
|||||||
|
|
||||||
{ #category : #initialization }
|
{ #category : #initialization }
|
||||||
DiyaText >> fontName: name style: face size: size [
|
DiyaText >> fontName: name style: face size: size [
|
||||||
name ifNotNil: [ fontName := name ].
|
name ifNotNil: [fontName := name].
|
||||||
face ifNotNil: [ fontStyle := face ].
|
face ifNotNil: [fontStyle := face].
|
||||||
|
|
||||||
|
fontName := fontName ifNil: [DiyaFontManager uniqueInstance defaultFamily].
|
||||||
|
fontStyle := fontStyle ifNil: [DiyaFontManager uniqueInstance defaultStyle].
|
||||||
|
|
||||||
fontSize := size.
|
fontSize := size.
|
||||||
style := DiyaFontManager uniqueInstance style: self fontStyle from: self fontName.
|
style := DiyaFontManager uniqueInstance style: self fontStyle from: self fontName.
|
||||||
dirty := true.
|
dirty := true.
|
||||||
@ -96,21 +110,11 @@ DiyaText >> fontStyle [
|
|||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
DiyaText >> getCharsVerticesAt:i offset: offset on: tex2D [
|
DiyaText >> getCharsVerticesAt:i offset: offset on: tex2D [
|
||||||
|x y w h glyph gsize c texcoord|
|
|x y w h glyph gsize c texcoord|
|
||||||
c := (data at:i) asciiValue.
|
c := (data at:i) asInteger.
|
||||||
c = (Character space asciiValue) ifTrue:[
|
|
||||||
offset setX: (offset x + (tex2D spacing ) ) setY: offset y.
|
|
||||||
wrap ifTrue: [
|
|
||||||
(offset x + ((self nextSpaceFrom: i + 1) * (tex2D fontSize))) > (self extent x) ifTrue: [
|
|
||||||
offset setX: 0.0 setY: (offset y )- (tex2D linespace)].
|
|
||||||
].
|
|
||||||
^ {}.
|
|
||||||
].
|
|
||||||
glyph := tex2D getGlyph: c.
|
glyph := tex2D getGlyph: c.
|
||||||
gsize := glyph extent.
|
gsize := glyph extent.
|
||||||
((offset x > self extent x) and: (gsize x > 0)) ifTrue:[
|
((offset x > self extent x) and: (gsize x > 0)) ifTrue:[
|
||||||
wrap ifFalse: [ ^ { } ].
|
wrap ifFalse: [ ^ { } ].
|
||||||
offset setX: 0.0 setY: (offset y )- (tex2D linespace).
|
|
||||||
offset y negated > self extent y ifTrue:[^{}].
|
|
||||||
].
|
].
|
||||||
x := offset x + (glyph bearing x).
|
x := offset x + (glyph bearing x).
|
||||||
y := offset y - (tex2D cellh).
|
y := offset y - (tex2D cellh).
|
||||||
@ -126,20 +130,35 @@ DiyaText >> getCharsVerticesAt:i offset: offset on: tex2D [
|
|||||||
x + w. y + h. texcoord corner x. texcoord origin y. }.
|
x + w. y + h. texcoord corner x. texcoord origin y. }.
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
DiyaText >> getLinebreakIndices: delta [
|
||||||
|
|indices idx|
|
||||||
|
indices := Set new.
|
||||||
|
idx := delta + 1.
|
||||||
|
[
|
||||||
|
idx < data size
|
||||||
|
] whileTrue: [
|
||||||
|
indices add: (self lastSeparatorFrom: idx) + 1.
|
||||||
|
idx := idx + delta.
|
||||||
|
].
|
||||||
|
^indices
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #initialization }
|
{ #category : #initialization }
|
||||||
DiyaText >> initialize [
|
DiyaText >> initialize [
|
||||||
super initialize.
|
super initialize.
|
||||||
self fontName: 'Ubuntu' style:'Regular' size: 16.
|
"self fontName: 'Ubuntu' style:'Regular' size: 16."
|
||||||
data := nil.
|
data := nil.
|
||||||
wrap := false.
|
wrap := false.
|
||||||
bbox := nil.
|
bbox := nil.
|
||||||
texheight := 0.
|
texheight := 0.
|
||||||
|
self fontSize: 16
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #'as yet unclassified' }
|
{ #category : #'as yet unclassified' }
|
||||||
DiyaText >> nextSpaceFrom: index [
|
DiyaText >> lastSeparatorFrom: index [
|
||||||
index to: (data size) do: [:i|
|
index to: 1 by: -1 do: [:i|
|
||||||
(data at: i) = (Character space) ifTrue:[^i - index].
|
(data at: i) isSeparator ifTrue:[^i].
|
||||||
].
|
].
|
||||||
^ 0
|
^ 0
|
||||||
]
|
]
|
||||||
|
@ -11,7 +11,8 @@ Class {
|
|||||||
'rowp',
|
'rowp',
|
||||||
'face',
|
'face',
|
||||||
'maxbearing',
|
'maxbearing',
|
||||||
'maxrows'
|
'maxrows',
|
||||||
|
'meanww'
|
||||||
],
|
],
|
||||||
#pools : [
|
#pools : [
|
||||||
'OpenGLConstants',
|
'OpenGLConstants',
|
||||||
@ -63,7 +64,7 @@ OpenGLFontTex >> fontSize [
|
|||||||
|
|
||||||
{ #category : #'instance creation' }
|
{ #category : #'instance creation' }
|
||||||
OpenGLFontTex >> fromFace: aFace ofSize: size [
|
OpenGLFontTex >> fromFace: aFace ofSize: size [
|
||||||
|minhang rec iptr charcode w|
|
|minhang rec iptr charcode w numw|
|
||||||
fontSize := size.
|
fontSize := size.
|
||||||
face := aFace.
|
face := aFace.
|
||||||
charmap := Dictionary new.
|
charmap := Dictionary new.
|
||||||
@ -73,6 +74,8 @@ OpenGLFontTex >> fromFace: aFace ofSize: size [
|
|||||||
iptr at:1 put: 0.
|
iptr at:1 put: 0.
|
||||||
rec := (FTFaceRec fromHandle: face getHandle).
|
rec := (FTFaceRec fromHandle: face getHandle).
|
||||||
charcode := face getFirstChar: iptr getHandle.
|
charcode := face getFirstChar: iptr getHandle.
|
||||||
|
meanww := 0.
|
||||||
|
numw := 0.
|
||||||
[ (iptr at: 1) = 0 ] whileFalse: [
|
[ (iptr at: 1) = 0 ] whileFalse: [
|
||||||
face loadCharacter: charcode flags: (1 << 2).
|
face loadCharacter: charcode flags: (1 << 2).
|
||||||
w := ((rec glyph metrics width) >> 6).
|
w := ((rec glyph metrics width) >> 6).
|
||||||
@ -80,11 +83,14 @@ OpenGLFontTex >> fromFace: aFace ofSize: size [
|
|||||||
maxbearing := maxbearing max: ((rec glyph metrics horiBearingY) >> 6).
|
maxbearing := maxbearing max: ((rec glyph metrics horiBearingY) >> 6).
|
||||||
cellw := cellw max: w.
|
cellw := cellw max: w.
|
||||||
minhang := minhang min: ((( rec glyph metrics horiBearingY) - (rec glyph metrics height)) >> 6).
|
minhang := minhang min: ((( rec glyph metrics horiBearingY) - (rec glyph metrics height)) >> 6).
|
||||||
|
meanww := meanww + w.
|
||||||
|
numw := numw + 1.
|
||||||
].
|
].
|
||||||
charcode := face getNextChar: charcode iptr: iptr getHandle.
|
charcode := face getNextChar: charcode iptr: iptr getHandle.
|
||||||
].
|
].
|
||||||
cellh := maxbearing - minhang.
|
cellh := maxbearing - minhang.
|
||||||
spacing := (cellw >> 2) asInteger.
|
spacing := (cellw >> 2) asInteger.
|
||||||
|
meanww := meanww / numw.
|
||||||
maxrows := 8.
|
maxrows := 8.
|
||||||
data := FFIExternalArray externalNewType: GLubyte size:cellw * cellh * (maxrows << 5).
|
data := FFIExternalArray externalNewType: GLubyte size:cellw * cellh * (maxrows << 5).
|
||||||
LibC memset: data getHandle value: 0 size: data size.
|
LibC memset: data getHandle value: 0 size: data size.
|
||||||
@ -145,6 +151,11 @@ OpenGLFontTex >> linespace [
|
|||||||
^ cellh
|
^ cellh
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
OpenGLFontTex >> meanww [
|
||||||
|
^ meanww
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
OpenGLFontTex >> reallocateBuffer [
|
OpenGLFontTex >> reallocateBuffer [
|
||||||
|newbuffer|
|
|newbuffer|
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
Extension { #name : #'SDL_MouseMotionEvent' }
|
Extension { #name : #'SDL_MouseMotionEvent' }
|
||||||
|
|
||||||
{ #category : #'*Diya' }
|
{ #category : #'*Diya' }
|
||||||
SDL_MouseMotionEvent >> triggableOn: aNode [
|
SDL_MouseMotionEvent >> triggableOn: arg1 [
|
||||||
^false
|
^ arg1 inner: self worldPosition
|
||||||
"^ aNode inner: self worldPosition "
|
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #'*Diya' }
|
{ #category : #'*Diya' }
|
||||||
|
@ -7,5 +7,7 @@ SDL_TouchFingerEvent >> triggableOn: aNode [
|
|||||||
|
|
||||||
{ #category : #'*Diya' }
|
{ #category : #'*Diya' }
|
||||||
SDL_TouchFingerEvent >> worldPosition [
|
SDL_TouchFingerEvent >> worldPosition [
|
||||||
^ (self x) @ (DiyaRendererContext uniqueInstance resolution y - self y )
|
|resolution|
|
||||||
|
resolution := DiyaRendererContext uniqueInstance resolution.
|
||||||
|
^((self x)* (resolution x) ) @ ((1.0 - self y)* (resolution y)).
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user