summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2018-08-26 17:26:53 -0400
committerPietro Gagliardi <[email protected]>2018-08-26 17:26:53 -0400
commitdd9db1c14586ecec7e9783f09cceb86fd04825ce (patch)
tree76436a0144e831ce107fd2c12b39596dafe2e583
parent2c275b76aefba775c140584fe39a1912cd4556ff (diff)
And migrated the examples back; also fixed a spot I missed.
-rw-r--r--draw.go2
-rw-r--r--zz_controls.go (renamed from BBB_GOFILES/zz_controls.go)0
-rw-r--r--zz_drawtext.go (renamed from BBB_GOFILES/zz_drawtext.go)0
-rw-r--r--zz_histogram.go (renamed from BBB_GOFILES/zz_histogram.go)24
4 files changed, 13 insertions, 13 deletions
diff --git a/draw.go b/draw.go
index 59f8e5d..4e02e65 100644
--- a/draw.go
+++ b/draw.go
@@ -190,7 +190,7 @@ const (
)
// TODO document
-const DefaultMiterLimit = 10.0
+const DrawDefaultMiterLimit = 10.0
// TODO
type DrawBrush struct {
diff --git a/BBB_GOFILES/zz_controls.go b/zz_controls.go
index d77bebe..d77bebe 100644
--- a/BBB_GOFILES/zz_controls.go
+++ b/zz_controls.go
diff --git a/BBB_GOFILES/zz_drawtext.go b/zz_drawtext.go
index a32b14b..a32b14b 100644
--- a/BBB_GOFILES/zz_drawtext.go
+++ b/zz_drawtext.go
diff --git a/BBB_GOFILES/zz_histogram.go b/zz_histogram.go
index eb0c8c4..610d65a 100644
--- a/BBB_GOFILES/zz_histogram.go
+++ b/zz_histogram.go
@@ -29,8 +29,8 @@ const (
)
// helper to quickly set a brush color
-func mkSolidBrush(color uint32, alpha float64) *ui.Brush {
- brush := new(ui.Brush)
+func mkSolidBrush(color uint32, alpha float64) *ui.DrawBrush {
+ brush := new(ui.DrawBrush)
brush.Type = ui.DrawBrushTypeSolid
component := uint8((color >> 16) & 0xFF)
brush.R = float64(component) / 255
@@ -64,9 +64,9 @@ func pointLocations(width, height float64) (xs, ys [10]float64) {
return xs, ys
}
-func constructGraph(width, height float64, extend bool) *ui.Path {
+func constructGraph(width, height float64, extend bool) *ui.DrawPath {
xs, ys := pointLocations(width, height)
- path := ui.NewPath(ui.DrawFillModeWinding)
+ path := ui.DrawNewPath(ui.DrawFillModeWinding)
path.NewFigure(xs[0], ys[0])
for i := 1; i < 10; i++ {
@@ -93,7 +93,7 @@ type areaHandler struct{}
func (areaHandler) Draw(a *ui.Area, p *ui.AreaDrawParams) {
// fill the area with white
brush := mkSolidBrush(colorWhite, 1.0)
- path := ui.NewPath(ui.DrawFillModeWinding)
+ path := ui.DrawNewPath(ui.DrawFillModeWinding)
path.AddRectangle(0, 0, p.AreaWidth, p.AreaHeight)
path.End()
p.Context.Fill(path, brush)
@@ -101,16 +101,16 @@ func (areaHandler) Draw(a *ui.Area, p *ui.AreaDrawParams) {
graphWidth, graphHeight := graphSize(p.AreaWidth, p.AreaHeight)
- sp := &ui.StrokeParams{
- Cap: ui.FlatCap,
- Join: ui.MiterJoin,
+ sp := &ui.DrawStrokeParams{
+ Cap: ui.DrawLineCapFlat,
+ Join: ui.DrawLineJoinMiter,
Thickness: 2,
- MiterLimit: ui.DefaultMiterLimit,
+ MiterLimit: ui.DrawDefaultMiterLimit,
}
// draw the axes
brush = mkSolidBrush(colorBlack, 1.0)
- path = ui.NewPath(ui.DrawFillModeWinding)
+ path = ui.DrawNewPath(ui.DrawFillModeWinding)
path.NewFigure(xoffLeft, yoffTop)
path.LineTo(xoffLeft, yoffTop + graphHeight)
path.LineTo(xoffLeft + graphWidth, yoffTop + graphHeight)
@@ -119,7 +119,7 @@ func (areaHandler) Draw(a *ui.Area, p *ui.AreaDrawParams) {
path.Free()
// now transform the coordinate space so (0, 0) is the top-left corner of the graph
- m := ui.NewMatrix()
+ m := ui.DrawNewMatrix()
m.Translate(xoffLeft, yoffTop)
p.Context.Transform(m)
@@ -146,7 +146,7 @@ func (areaHandler) Draw(a *ui.Area, p *ui.AreaDrawParams) {
// now draw the point being hovered over
if currentPoint != -1 {
xs, ys := pointLocations(graphWidth, graphHeight)
- path = ui.NewPath(ui.DrawFillModeWinding)
+ path = ui.DrawNewPath(ui.DrawFillModeWinding)
path.NewFigureWithArc(
xs[currentPoint], ys[currentPoint],
pointRadius,