blooblib/draw_line.go

14 lines
330 B
Go
Raw Normal View History

2024-03-25 05:56:33 +01:00
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
}
}