Skip to content

Commit

Permalink
deps: update to v0.9.0 and cimgui-go to v1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
gucio321 committed Oct 4, 2024
1 parent 874efa5 commit ad7f6cb
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 54 deletions.
2 changes: 1 addition & 1 deletion _examples/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (

"golang.org/x/image/colornames"

"github.com/AllenDang/cimgui-go/imgui"
"github.com/AllenDang/giu"
"github.com/AllenDang/imgui-go"

animations "github.com/gucio321/giu-animations/v2"
)
Expand Down
4 changes: 2 additions & 2 deletions animator.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var (
// please open an issue in source repository.
type AnimatorWidget struct {
// giu ID used for storing internal state
id string
id giu.ID

// playback properties
duration time.Duration
Expand Down Expand Up @@ -66,7 +66,7 @@ func Animator(a Animation) *AnimatorWidget {
// sometimes when using sub-animators inside of Transition, it may happen
// that the second AnimatorWidget will receive the same ID as the previous one.
// It may cause unexpected behaviors.
func (a *AnimatorWidget) ID(newID string) *AnimatorWidget {
func (a *AnimatorWidget) ID(newID giu.ID) *AnimatorWidget {
a.id = newID

return a
Expand Down
8 changes: 4 additions & 4 deletions color_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ package animations
import (
"image/color"

"github.com/AllenDang/cimgui-go/imgui"
"github.com/AllenDang/giu"
"github.com/AllenDang/imgui-go"
)

var _ Animation = &ColorFlowAnimation{}

// ColorFlowAnimation makes a smooth flow from one color to another
// on all specified StyleColor variables.
type ColorFlowAnimation struct {
id string
id giu.ID

giu.Widget
applyingStyles []giu.StyleColorID
Expand All @@ -29,10 +29,10 @@ func ColorFlowStyle(
widget,
[]giu.StyleColorID{normal, destiny},
func() color.RGBA {
return giu.Vec4ToRGBA(imgui.CurrentStyle().GetColor(imgui.StyleColorID(normal)))
return giu.Vec4ToRGBA(*imgui.StyleColorVec4(imgui.Col(normal)))
},
func() color.RGBA {
return giu.Vec4ToRGBA(imgui.CurrentStyle().GetColor(imgui.StyleColorID(destiny)))
return giu.Vec4ToRGBA(*imgui.StyleColorVec4(imgui.Col(destiny)))
},
)
}
Expand Down
26 changes: 13 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
module github.com/gucio321/giu-animations/v2

go 1.19
go 1.22

toolchain go1.23.1

require (
github.com/AllenDang/giu v0.6.3-0.20221213134548-da051513855e
github.com/AllenDang/imgui-go v1.12.1-0.20221124025851-59b862ca5a0c
github.com/AllenDang/cimgui-go v1.0.1
github.com/AllenDang/giu v0.9.0
)

require (
github.com/AllenDang/go-findfont v0.0.0-20200702051237-9f180485aeb8 // indirect
github.com/faiface/mainthread v0.0.0-20171120011319-8b78f0a41ae3 // indirect
github.com/go-gl/gl v0.0.0-20211210172815-726fda9656d6 // indirect
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20221017161538-93cebf72946b // indirect
github.com/mazznoer/csscolorparser v0.1.3 // indirect
github.com/napsy/go-css v0.0.0-20221107082635-4ed403047a64 // indirect
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect
github.com/sahilm/fuzzy v0.1.0 // indirect
golang.org/x/image v0.18.0 // indirect
golang.org/x/sys v0.5.0 // indirect
github.com/mazznoer/csscolorparser v0.1.5 // indirect
github.com/napsy/go-css v0.0.0-20230611142900-9dd118f3874c // indirect
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
github.com/sahilm/fuzzy v0.1.1 // indirect
golang.design/x/hotkey v0.4.1 // indirect
golang.design/x/mainthread v0.3.0 // indirect
golang.org/x/image v0.20.0 // indirect
golang.org/x/sys v0.25.0 // indirect
gopkg.in/eapache/queue.v1 v1.1.0 // indirect
)

replace github.com/AllenDang/giu => github.com/gucio321/giu v0.6.3-0.20230216184243-00bc8eae4793
59 changes: 31 additions & 28 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,39 +1,42 @@
github.com/AllenDang/cimgui-go v1.0.1 h1:wByh6LaBj+g8FJSSWA0FdxbrWjv+51CSz809f4O+97E=
github.com/AllenDang/cimgui-go v1.0.1/go.mod h1:H3N42+ltguWTxs2wCKnmutpKhnUdqGadSmbXvW1TKDs=
github.com/AllenDang/giu v0.8.1 h1:tWApn79v2Vima4aPzmuWkBB+TEmXufXDeHdXWIcSvSk=
github.com/AllenDang/giu v0.8.1/go.mod h1:ut6UO5zmkYfvQB7rdPDS9yb2EnfpRvlTv2Qht4bqzK8=
github.com/AllenDang/giu v0.8.2-0.20241004081602-bf0e86eecea6 h1:1Nz6I/pJyRI2sLFzwR40SH32REHBmt5YJQSloTYtOfo=
github.com/AllenDang/giu v0.8.2-0.20241004081602-bf0e86eecea6/go.mod h1:mrRY0l6wOnjzHSlLdQ0+Pb4yZs7NjaNe8HyjtilVQf8=
github.com/AllenDang/giu v0.9.0 h1:ysGA7dKEWnc1AUKuftwAmOcquF7nwKhYCxWlMGzrDXQ=
github.com/AllenDang/giu v0.9.0/go.mod h1:mrRY0l6wOnjzHSlLdQ0+Pb4yZs7NjaNe8HyjtilVQf8=
github.com/AllenDang/go-findfont v0.0.0-20200702051237-9f180485aeb8 h1:dKZMqib/yUDoCFigmz2agG8geZ/e3iRq304/KJXqKyw=
github.com/AllenDang/go-findfont v0.0.0-20200702051237-9f180485aeb8/go.mod h1:b4uuDd0s6KRIPa84cEEchdQ9ICh7K0OryZHbSzMca9k=
github.com/AllenDang/imgui-go v1.12.1-0.20221124025851-59b862ca5a0c h1:kiXjH0n0KzOpvhgy3nDFkPmKfg4A+QWsEOwxwWy6yuI=
github.com/AllenDang/imgui-go v1.12.1-0.20221124025851-59b862ca5a0c/go.mod h1:kuPs9RWleaUuK7D49bE6HPxyRA36Lp4ICKGp+5OnnbY=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/faiface/mainthread v0.0.0-20171120011319-8b78f0a41ae3 h1:baVdMKlASEHrj19iqjARrPbaRisD7EuZEVJj6ZMLl1Q=
github.com/faiface/mainthread v0.0.0-20171120011319-8b78f0a41ae3/go.mod h1:VEPNJUlxl5KdWjDvz6Q1l+rJlxF2i6xqDeGuGAxa87M=
github.com/go-gl/gl v0.0.0-20211210172815-726fda9656d6 h1:zDw5v7qm4yH7N8C8uWd+8Ii9rROdgWxQuGoJ9WDXxfk=
github.com/go-gl/gl v0.0.0-20211210172815-726fda9656d6/go.mod h1:9YTyiznxEY1fVinfM7RvRcjRHbw2xLBJ3AAGIT0I4Nw=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20211213063430-748e38ca8aec/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20221017161538-93cebf72946b h1:GgabKamyOYguHqHjSkDACcgoPIz3w0Dis/zJ1wyHHHU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20221017161538-93cebf72946b/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/gucio321/giu v0.6.3-0.20230216184243-00bc8eae4793 h1:xQLDGC4A6zlp2Rf4GScfgSggmtT9Y36LuT/x3kGawLw=
github.com/gucio321/giu v0.6.3-0.20230216184243-00bc8eae4793/go.mod h1:hSaf4jvGDy8PcRYGTAneUN4aV3rjDhMLylFQcQqCYS0=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/mazznoer/csscolorparser v0.1.3 h1:vug4zh6loQxAUxfU1DZEu70gTPufDPspamZlHAkKcxE=
github.com/mazznoer/csscolorparser v0.1.3/go.mod h1:Aj22+L/rYN/Y6bj3bYqO3N6g1dtdHtGfQ32xZ5PJQic=
github.com/napsy/go-css v0.0.0-20221107082635-4ed403047a64 h1:7LWtWY3Ei9ghnamqn8xCu7LOXAKaQrcfbcf0sU33LG4=
github.com/napsy/go-css v0.0.0-20221107082635-4ed403047a64/go.mod h1:HqZYcKcNnv50fgOTdGUn9YbJa2qC9oJ3kLnyrwwVzUI=
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU=
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/mazznoer/csscolorparser v0.1.5 h1:Wr4uNIE+pHWN3TqZn2SGpA2nLRG064gB7WdSfSS5cz4=
github.com/mazznoer/csscolorparser v0.1.5/go.mod h1:OQRVvgCyHDCAquR1YWfSwwaDcM0LhnSffGnlbOew/3I=
github.com/napsy/go-css v0.0.0-20230611142900-9dd118f3874c h1:La4rUnvsKPtQ468QEIAprCeAFdIRigErRuws3EhOkNw=
github.com/napsy/go-css v0.0.0-20230611142900-9dd118f3874c/go.mod h1:HqZYcKcNnv50fgOTdGUn9YbJa2qC9oJ3kLnyrwwVzUI=
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sahilm/fuzzy v0.1.0 h1:FzWGaw2Opqyu+794ZQ9SYifWv2EIXpwP4q8dY1kDAwI=
github.com/sahilm/fuzzy v0.1.0/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
golang.org/x/image v0.18.0 h1:jGzIakQa/ZXI1I0Fxvaa9W7yP25TqT6cHIHn+6CqvSQ=
golang.org/x/image v0.18.0/go.mod h1:4yyo5vMFQjVjUcVk4jEQcU9MGy/rulF5WvUILseCM2E=
golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
github.com/sahilm/fuzzy v0.1.1 h1:ceu5RHF8DGgoi+/dR5PsECjCDH1BE3Fnmpo7aVXOdRA=
github.com/sahilm/fuzzy v0.1.1/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
golang.design/x/hotkey v0.4.1 h1:zLP/2Pztl4WjyxURdW84GoZ5LUrr6hr69CzJFJ5U1go=
golang.design/x/hotkey v0.4.1/go.mod h1:M8SGcwFYHnKRa83FpTFQoZvPO5vVT+kWPztFqTQKmXA=
golang.design/x/mainthread v0.3.0 h1:UwFus0lcPodNpMOGoQMe87jSFwbSsEY//CA7yVmu4j8=
golang.design/x/mainthread v0.3.0/go.mod h1:vYX7cF2b3pTJMGM/hc13NmN6kblKnf4/IyvHeu259L0=
golang.org/x/image v0.20.0 h1:7cVCUjQwfL18gyBJOmYvptfSHS8Fb3YUDtfLIZ7Nbpw=
golang.org/x/image v0.20.0/go.mod h1:0a88To4CYVBAHp5FXJm8o7QbUl37Vd85ply1vyD8auM=
golang.org/x/sys v0.0.0-20201022201747-fb209a7c41cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
gopkg.in/eapache/queue.v1 v1.1.0 h1:EldqoJEGtXYiVCMRo2C9mePO2UUGnYn2+qLmlQSqPdc=
gopkg.in/eapache/queue.v1 v1.1.0/go.mod h1:wNtmx1/O7kZSR9zNT1TTOJ7GLpm3Vn7srzlfylFbQwU=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
2 changes: 1 addition & 1 deletion helpers.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package animations

import "github.com/AllenDang/imgui-go"
import "github.com/AllenDang/cimgui-go/imgui"

func vecSum(vec1, vec2 imgui.Vec2) imgui.Vec2 {
return imgui.Vec2{
Expand Down
2 changes: 1 addition & 1 deletion math.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package animations
import (
"math"

"github.com/AllenDang/imgui-go"
"github.com/AllenDang/cimgui-go/imgui"
)

func factorial(n int) int {
Expand Down
4 changes: 2 additions & 2 deletions move.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ package animations
import (
"log"

"github.com/AllenDang/cimgui-go/imgui"
"github.com/AllenDang/giu"
"github.com/AllenDang/imgui-go"
)

var _ Animation = &MoveAnimation{}

// MoveAnimation moves animation widget from start position to destination.
// You can also specify animation Bézier curve's points.
type MoveAnimation struct {
id string
id giu.ID

widget func(starter StarterFunc) giu.Widget
steps []*MoveStep
Expand Down
2 changes: 1 addition & 1 deletion move_step.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package animations

import "github.com/AllenDang/imgui-go"
import "github.com/AllenDang/cimgui-go/imgui"

// MoveStep represents animation single key frame in context of MoveAnimation.
// If Relative() not set, positionDelta is relative to this in animation previous step.
Expand Down
2 changes: 1 addition & 1 deletion transition.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package animations

import (
"github.com/AllenDang/imgui-go"
"github.com/AllenDang/cimgui-go/imgui"
)

var _ Animation = &TransitionAnimation{}
Expand Down

0 comments on commit ad7f6cb

Please sign in to comment.