Skip to content

Commit

Permalink
Merge pull request #897 from gucio321/gizmo-widget
Browse files Browse the repository at this point in the history
add Gizmo widget and example for it
  • Loading branch information
gucio321 authored Oct 30, 2024
2 parents 4fb044d + 9099cfd commit 1d7a4e7
Show file tree
Hide file tree
Showing 7 changed files with 599 additions and 4 deletions.
11 changes: 10 additions & 1 deletion ExtraWidgets.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,11 @@ func (h *SplitterWidget) Build() {
canvas.AddRectFilled(pt.Add(ptMin), pt.Add(ptMax), c, 0, 0)
}

var _ Widget = &CustomWidget{}
var (
_ Widget = &CustomWidget{}
_ PlotWidget = &CustomWidget{}
_ GizmoI = &CustomWidget{}
)

// CustomWidget allows you to do whatever you want.
// This includes:
Expand Down Expand Up @@ -142,6 +146,11 @@ func (c *CustomWidget) Plot() {
c.Build()
}

// Gizmo implements GizmoI interface.
func (c *CustomWidget) Gizmo(_ *ViewMatrix, _ *ProjectionMatrix) {
c.Build()
}

var _ Widget = &ConditionWidget{}

// ConditionWidget allows to build if a condition is met
Expand Down
Loading

0 comments on commit 1d7a4e7

Please sign in to comment.