From 28c631f4a87b1383f9a43b92e76c378a34f1ac1f Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Mon, 5 Oct 2026 19:24:14 +0900 Subject: [PATCH] align toolkit SDL3 ugprade - upgrade SDL3 in the github build test - match Toolkit motion callback signatures --- .github/workflows/build_test.yml | 4 ++-- src/Intersects.cpp | 6 +++--- src/LottieInteraction.cpp | 6 +++--- src/LottieTweening.cpp | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index c5afa43..5c66153 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -13,14 +13,14 @@ permissions: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 steps: - uses: actions/checkout@v4 - name: Install Packages run: | sudo apt-get update - sudo apt-get install meson ninja-build pkg-config libsdl2-dev + sudo apt-get install --no-install-recommends -y meson ninja-build pkg-config libsdl3-dev - name: Install ThorVG run: | diff --git a/src/Intersects.cpp b/src/Intersects.cpp index 3c89da1..0a3084f 100644 --- a/src/Intersects.cpp +++ b/src/Intersects.cpp @@ -115,11 +115,11 @@ struct UserExample : tvgexam::Example return true; } - bool motion(tvg::Canvas* canvas, int32_t x, int32_t y) override + bool motion(tvg::Canvas* canvas, float x, float y) override { //center align - mx = x - (mw / 2); - my = y - (mh / 2); + mx = static_cast(x - float(mw) * 0.5f); + my = static_cast(y - float(mh) * 0.5f); return false; } diff --git a/src/LottieInteraction.cpp b/src/LottieInteraction.cpp index 4a1360a..7bf61ad 100644 --- a/src/LottieInteraction.cpp +++ b/src/LottieInteraction.cpp @@ -69,7 +69,7 @@ struct UserExample : tvgexam::Example return degree; } - bool clickdown(tvg::Canvas* canvas, int32_t x, int32_t y, uint8_t button) override + bool clickdown(tvg::Canvas* canvas, float x, float y, uint8_t button) override { down = {float(x), float(y)}; prv = {float(x) - origin.x, float(y) - origin.y}; @@ -80,7 +80,7 @@ struct UserExample : tvgexam::Example return false; } - bool clickup(tvg::Canvas* canvas, int32_t x, int32_t y, uint8_t button) override + bool clickup(tvg::Canvas* canvas, float x, float y, uint8_t button) override { pressed = false; @@ -108,7 +108,7 @@ struct UserExample : tvgexam::Example tvgexam::verify(lottie->apply(slot.rotation)); } - bool motion(tvg::Canvas* canvas, int32_t x, int32_t y) override + bool motion(tvg::Canvas* canvas, float x, float y) override { cur = {float(x) - origin.x, float(y) - origin.y}; if (!pressed) return false; diff --git a/src/LottieTweening.cpp b/src/LottieTweening.cpp index 6ae9d83..4e6c5fd 100644 --- a/src/LottieTweening.cpp +++ b/src/LottieTweening.cpp @@ -89,7 +89,7 @@ struct UserExample : tvgexam::Example std::cout << "tween to: " << states[stateIdx].name << std::endl; } - bool clickdown(tvg::Canvas* canvas, int32_t x, int32_t y, uint8_t button) override + bool clickdown(tvg::Canvas* canvas, float x, float y, uint8_t button) override { int i = 0; for (auto& state : states) {