Compare commits
1 Commits
34e652cb5e
...
4dc3773459
Author | SHA1 | Date | |
---|---|---|---|
4dc3773459 |
@ -287,6 +287,14 @@ func (r *Renderer) Line(p, q geom.PointF32, color color.Color, thickness float32
|
||||
allg5.DrawLine(p.X, p.Y, q.X, q.Y, newColor(color), thickness)
|
||||
}
|
||||
|
||||
func (r *Renderer) Location() geom.Point {
|
||||
return geom.Pt(r.disp.Position()...)
|
||||
}
|
||||
|
||||
func (r *Renderer) Move(to geom.Point) {
|
||||
r.disp.SetPosition(to.X, to.Y)
|
||||
}
|
||||
|
||||
func (r *Renderer) mustGetBitmap(t ui.Texture) *allg5.Bitmap {
|
||||
texture, ok := t.(*texture)
|
||||
if !ok {
|
||||
|
@ -374,6 +374,15 @@ func (r *Renderer) Line(p, q geom.PointF32, color color.Color, thickness float32
|
||||
r.renderer.DrawLineF(p.X, p.Y, q.X, q.Y)
|
||||
}
|
||||
|
||||
func (r *Renderer) Location() geom.Point {
|
||||
x, y := r.renderer.GetPosition()
|
||||
return geom.Pt(int(x), int(y))
|
||||
}
|
||||
|
||||
func (r *Renderer) Move(to geom.Point) {
|
||||
r.renderer.SetPosition(int32(to.X), int32(to.Y))
|
||||
}
|
||||
|
||||
func (r *Renderer) Rectangle(rect geom.RectangleF32, c color.Color, thickness float32) {
|
||||
r.SetDrawColorGo(c)
|
||||
if rect.Dx() == 0 { // SDL doesn't draw a 1 px wide line when Dx() == 0 && thickness == 1
|
||||
|
@ -31,6 +31,8 @@ type Renderer interface {
|
||||
DrawTexturePointOptions(t Texture, p geom.PointF32, opts DrawOptions)
|
||||
FillRectangle(r geom.RectangleF32, c color.Color)
|
||||
Line(p, q geom.PointF32, color color.Color, thickness float32)
|
||||
Location() geom.Point
|
||||
Move(geom.Point)
|
||||
Rectangle(r geom.RectangleF32, c color.Color, thickness float32)
|
||||
RenderTo(Texture)
|
||||
RenderToDisplay()
|
||||
|
Loading…
Reference in New Issue
Block a user