Create another For iterator that leaves out the fake null rune

Apparently it was intended behavior. Closes #4
This commit is contained in:
2024-09-03 18:38:01 -04:00
parent 021dd288b6
commit 6a60458484
2 changed files with 26 additions and 14 deletions
+5 -5
View File
@@ -13,20 +13,20 @@ type Drawer struct { TypeSetter }
// Draw draws the drawer's text onto the specified canvas at the given offset.
func (drawer Drawer) Draw (
destination draw.Image,
color color.Color,
col color.Color,
offset image.Point,
) (
updatedRegion image.Rectangle,
) {
source := image.NewUniform(color)
source := image.NewUniform(col)
drawer.For (func (
drawer.ForRunes (func (
index int,
char rune,
position fixed.Point26_6,
) bool {
// leave empty space for space characters
if unicode.IsSpace(char){
if unicode.IsSpace(char) {
return true
}
@@ -37,7 +37,7 @@ func (drawer Drawer) Draw (
mask, maskPoint, _, ok := drawer.face.Glyph(dot, char)
// tofu
if !ok {
drawer.drawTofu(char, destination, color, dot)
drawer.drawTofu(char, destination, col, dot)
return true
}