mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 17:35:36 +00:00
text,widget: use != for flag tests
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+4
-4
@@ -125,13 +125,13 @@ func (g *glyphIndex) Glyph(gl text.Glyph) {
|
||||
g.positions = append(g.positions, pos)
|
||||
g.skipPrior = true
|
||||
}
|
||||
needsNewLine := gl.Flags&text.FlagLineBreak > 0
|
||||
needsNewRun := gl.Flags&text.FlagRunBreak > 0
|
||||
breaksParagraph := gl.Flags&text.FlagParagraphBreak > 0
|
||||
needsNewLine := gl.Flags&text.FlagLineBreak != 0
|
||||
needsNewRun := gl.Flags&text.FlagRunBreak != 0
|
||||
breaksParagraph := gl.Flags&text.FlagParagraphBreak != 0
|
||||
|
||||
// We should insert new positions if the glyph we're processing terminates
|
||||
// a glyph cluster.
|
||||
insertPositionAfter := gl.Flags&text.FlagClusterBreak > 0 && !breaksParagraph && gl.Runes > 0
|
||||
insertPositionAfter := gl.Flags&text.FlagClusterBreak != 0 && !breaksParagraph && gl.Runes > 0
|
||||
if breaksParagraph {
|
||||
// Paragraph breaking clusters shouldn't have positions generated for both
|
||||
// sides of them. They're always zero-width, so doing so would
|
||||
|
||||
+1
-1
@@ -145,7 +145,7 @@ func (it *textIterator) paintGlyph(gtx layout.Context, shaper *text.Shaper, glyp
|
||||
}
|
||||
line = append(line, glyph)
|
||||
}
|
||||
if glyph.Flags&text.FlagLineBreak > 0 || cap(line)-len(line) == 0 || !visibleOrBefore {
|
||||
if glyph.Flags&text.FlagLineBreak != 0 || cap(line)-len(line) == 0 || !visibleOrBefore {
|
||||
t := op.Offset(it.lineOff).Push(gtx.Ops)
|
||||
op := clip.Outline{Path: shaper.Shape(line)}.Op().Push(gtx.Ops)
|
||||
paint.PaintOp{}.Add(gtx.Ops)
|
||||
|
||||
Reference in New Issue
Block a user