mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 10:25:37 +00:00
text: convert clip.Ops to op.CallOp
MacroOp is about to lose the ability to run a different operation list than the one it was recorded on. Text shape caches rely on that property, and must use the new CallOp operation added for purpose. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+5
-5
@@ -3,7 +3,7 @@
|
||||
package text
|
||||
|
||||
import (
|
||||
"gioui.org/op/clip"
|
||||
"gioui.org/op"
|
||||
"golang.org/x/image/math/fixed"
|
||||
)
|
||||
|
||||
@@ -26,7 +26,7 @@ type layoutElem struct {
|
||||
type path struct {
|
||||
next, prev *path
|
||||
key pathKey
|
||||
val clip.Op
|
||||
val op.CallOp
|
||||
}
|
||||
|
||||
type layoutKey struct {
|
||||
@@ -81,16 +81,16 @@ func (l *layoutCache) insert(lt *layoutElem) {
|
||||
lt.next.prev = lt
|
||||
}
|
||||
|
||||
func (c *pathCache) Get(k pathKey) (clip.Op, bool) {
|
||||
func (c *pathCache) Get(k pathKey) (op.CallOp, bool) {
|
||||
if v, ok := c.m[k]; ok {
|
||||
c.remove(v)
|
||||
c.insert(v)
|
||||
return v.val, true
|
||||
}
|
||||
return clip.Op{}, false
|
||||
return op.CallOp{}, false
|
||||
}
|
||||
|
||||
func (c *pathCache) Put(k pathKey, v clip.Op) {
|
||||
func (c *pathCache) Put(k pathKey, v op.CallOp) {
|
||||
if c.m == nil {
|
||||
c.m = make(map[pathKey]*path)
|
||||
c.head = new(path)
|
||||
|
||||
Reference in New Issue
Block a user