blooblib/draw_line.go

14 lines
330 B
Go

package bloob
func (image *Image) DrawHLine(pos Vec2i, length int, color Color) {
for i := 0; i < length; i += 1 {
image.Data[pos.X+i+pos.Y*image.Size.X] = color
}
}
func (image *Image) DrawVLine(pos Vec2i, length int, color Color) {
for i := 0; i < length; i += 1 {
image.Data[pos.X+(pos.Y+i)*image.Size.X] = color
}
}