Skip to content

Commit

Permalink
add params gg.DrawPixelConfig for the .draw_pixel and .draw_pixels …
Browse files Browse the repository at this point in the history
…of DrawDevice as well
  • Loading branch information
spytheman committed Jul 31, 2024
1 parent 0584d99 commit 91c1c07
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/draw_device_bitmap.v
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,12 @@ pub fn (d &DrawDeviceBitmap) get_clipping() Rect {
}

// TODO: documentation
pub fn (d &DrawDeviceBitmap) draw_pixel(x f32, y f32, color gx.Color) {
pub fn (d &DrawDeviceBitmap) draw_pixel(x f32, y f32, color gx.Color, params gg.DrawPixelConfig) {
// println("$d.id draw_pixel($x, $y, $color)")
}

// TODO: documentation
pub fn (d &DrawDeviceBitmap) draw_pixels(points []f32, color gx.Color) {
pub fn (d &DrawDeviceBitmap) draw_pixels(points []f32, color gx.Color, params gg.DrawPixelConfig) {
// println("$d.id draw_pixels($points, $color)")
}

Expand Down
4 changes: 2 additions & 2 deletions src/draw_device_print.v
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ pub fn (d &DrawDevicePrint) get_clipping() Rect {
}

// TODO: documentation
pub fn (d &DrawDevicePrint) draw_pixel(x f32, y f32, color gx.Color) {
pub fn (d &DrawDevicePrint) draw_pixel(x f32, y f32, color gx.Color, params gg.DrawPixelConfig) {
println('${d.id} draw_pixel(${x}, ${y}, ${color})')
}

// TODO: documentation
pub fn (d &DrawDevicePrint) draw_pixels(points []f32, color gx.Color) {
pub fn (d &DrawDevicePrint) draw_pixels(points []f32, color gx.Color, params gg.DrawPixelConfig) {
println('${d.id} draw_pixels(${points}, ${color})')
}

Expand Down
4 changes: 2 additions & 2 deletions src/draw_device_svg.v
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,13 @@ pub fn (d &DrawDeviceSVG) get_clipping() Rect {
}

// TODO: documentation
pub fn (d &DrawDeviceSVG) draw_pixel(x f32, y f32, color gx.Color) {
pub fn (d &DrawDeviceSVG) draw_pixel(x f32, y f32, color gx.Color, params gg.DrawPixelConfig) {
mut s := d.s
s.rectangle(int(x), int(y), 1, 1, fill: hex_color(color))
}

// TODO: documentation
pub fn (d &DrawDeviceSVG) draw_pixels(points []f32, color gx.Color) {
pub fn (d &DrawDeviceSVG) draw_pixels(points []f32, color gx.Color, params gg.DrawPixelConfig) {
mut s := d.s
for i in 0 .. points.len / 2 {
s.rectangle(int(points[i * 2]), int(points[i * 2 + 1]), 1, 1, fill: hex_color(color))
Expand Down
4 changes: 2 additions & 2 deletions src/interface_draw_device.v
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ pub interface DrawDevice {
text_width(string) int
text_height(string) int
// drawing methods
draw_pixel(x f32, y f32, c gx.Color)
draw_pixels(points []f32, c gx.Color)
draw_pixel(x f32, y f32, c gx.Color, params gg.DrawPixelConfig)
draw_pixels(points []f32, c gx.Color, params gg.DrawPixelConfig)
draw_image(x f32, y f32, width f32, height f32, img &gg.Image)
draw_triangle_empty(x f32, y f32, x2 f32, y2 f32, x3 f32, y3 f32, color gx.Color)
draw_triangle_filled(x f32, y f32, x2 f32, y2 f32, x3 f32, y3 f32, color gx.Color)
Expand Down

0 comments on commit 91c1c07

Please sign in to comment.