Bug fix and UX improve #3

Merged
manbo merged 7 commits from dev-tauri into master 2026-02-15 18:18:14 +08:00
9 changed files with 58 additions and 48 deletions
Showing only changes of commit bed7a052f3 - Show all commits

Binary file not shown.

Before

Width:  |  Height:  |  Size: 404 B

View File

@@ -8,74 +8,74 @@
{
"name": "idle",
"fps": 1,
"frames": [0, 1, 2, 3, 4, 5, 6, 7]
"frames": [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7]
},
{
"name": "active",
"fps": 1,
"frames": [8, 9, 10, 11, 12, 13, 14, 15]
"frames": [8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15]
},
{
"name": "happy",
"fps": 1,
"frames": [8, 9, 10, 11, 12, 13, 14, 15]
"frames": [8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15]
},
{
"name": "love",
"fps": 1,
"frames": [8, 9, 10, 11, 12, 13, 14, 15]
"frames": [8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15]
},
{
"name": "excited",
"fps": 1,
"frames": [16, 17, 18, 19, 20, 21, 22, 23]
"frames": [16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23]
},
{
"name": "celebrate",
"fps": 2,
"frames": [16, 17, 18, 19, 20, 21, 22, 23],
"frames": [16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23],
"one_shot": true
},
{
"name": "success",
"fps": 2,
"frames": [16, 17, 18, 19, 20, 21, 22, 23],
"frames": [16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23],
"one_shot": true
},
{
"name": "sleepy",
"fps": 1,
"frames": [24, 25, 26, 27, 28, 29, 30, 31]
"frames": [24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27, 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31]
},
{
"name": "snoring",
"fps": 1,
"frames": [24, 25, 26, 27, 28, 29, 30, 31]
"frames": [24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27, 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31]
},
{
"name": "working",
"fps": 1,
"frames": [32, 33, 34, 35, 36, 37, 38, 39]
"frames": [32, 32, 32, 33, 33, 33, 34, 34, 34, 35, 35, 35, 36, 36, 36, 37, 37, 37, 38, 38, 38, 39, 39, 39]
},
{
"name": "angry",
"fps": 1,
"frames": [40, 41, 42, 43, 44, 45, 46, 47]
"frames": [40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47]
},
{
"name": "surprised",
"fps": 1,
"frames": [40, 41, 42, 43, 44, 45, 46, 47]
"frames": [40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47]
},
{
"name": "shy",
"fps": 1,
"frames": [40, 41, 42, 43, 44, 45, 46, 47]
"frames": [40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47]
},
{
"name": "error",
"fps": 1,
"frames": [40, 41, 42, 43, 44, 45, 46, 47]
"frames": [40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47]
},
{
"name": "dragging",

View File

@@ -8,74 +8,74 @@
{
"name": "idle",
"fps": 1,
"frames": [0, 1, 2, 3, 4, 5, 6, 7]
"frames": [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7]
},
{
"name": "active",
"fps": 1,
"frames": [8, 9, 10, 11, 12, 13, 14, 15]
"frames": [8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15]
},
{
"name": "happy",
"fps": 1,
"frames": [8, 9, 10, 11, 12, 13, 14, 15]
"frames": [8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15]
},
{
"name": "love",
"fps": 1,
"frames": [8, 9, 10, 11, 12, 13, 14, 15]
"frames": [8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15]
},
{
"name": "excited",
"fps": 1,
"frames": [16, 17, 18, 19, 20, 21, 22, 23]
"frames": [16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23]
},
{
"name": "celebrate",
"fps": 2,
"frames": [16, 17, 18, 19, 20, 21, 22, 23],
"frames": [16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23],
"one_shot": true
},
{
"name": "success",
"fps": 2,
"frames": [16, 17, 18, 19, 20, 21, 22, 23],
"frames": [16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23],
"one_shot": true
},
{
"name": "sleepy",
"fps": 1,
"frames": [24, 25, 26, 27, 28, 29, 30, 31]
"frames": [24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27, 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31]
},
{
"name": "snoring",
"fps": 1,
"frames": [24, 25, 26, 27, 28, 29, 30, 31]
"frames": [24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27, 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31]
},
{
"name": "working",
"fps": 1,
"frames": [32, 33, 34, 35, 36, 37, 38, 39]
"frames": [32, 32, 32, 33, 33, 33, 34, 34, 34, 35, 35, 35, 36, 36, 36, 37, 37, 37, 38, 38, 38, 39, 39, 39]
},
{
"name": "angry",
"fps": 1,
"frames": [40, 41, 42, 43, 44, 45, 46, 47]
"frames": [40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47]
},
{
"name": "surprised",
"fps": 1,
"frames": [40, 41, 42, 43, 44, 45, 46, 47]
"frames": [40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47]
},
{
"name": "shy",
"fps": 1,
"frames": [40, 41, 42, 43, 44, 45, 46, 47]
"frames": [40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47]
},
{
"name": "error",
"fps": 1,
"frames": [40, 41, 42, 43, 44, 45, 46, 47]
"frames": [40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47]
},
{
"name": "dragging",

View File

@@ -8,74 +8,74 @@
{
"name": "idle",
"fps": 1,
"frames": [0, 1, 2, 3, 4, 5, 6, 7]
"frames": [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7]
},
{
"name": "active",
"fps": 1,
"frames": [8, 9, 10, 11, 12, 13, 14, 15]
"frames": [8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15]
},
{
"name": "happy",
"fps": 1,
"frames": [8, 9, 10, 11, 12, 13, 14, 15]
"frames": [8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15]
},
{
"name": "love",
"fps": 1,
"frames": [8, 9, 10, 11, 12, 13, 14, 15]
"frames": [8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15]
},
{
"name": "excited",
"fps": 1,
"frames": [16, 17, 18, 19, 20, 21, 22, 23]
"frames": [16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23]
},
{
"name": "celebrate",
"fps": 2,
"frames": [16, 17, 18, 19, 20, 21, 22, 23],
"frames": [16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23],
"one_shot": true
},
{
"name": "success",
"fps": 2,
"frames": [16, 17, 18, 19, 20, 21, 22, 23],
"frames": [16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23],
"one_shot": true
},
{
"name": "sleepy",
"fps": 1,
"frames": [24, 25, 26, 27, 28, 29, 30, 31]
"frames": [24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27, 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31]
},
{
"name": "snoring",
"fps": 1,
"frames": [24, 25, 26, 27, 28, 29, 30, 31]
"frames": [24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27, 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31]
},
{
"name": "working",
"fps": 1,
"frames": [32, 33, 34, 35, 36, 37, 38, 39]
"frames": [32, 32, 32, 33, 33, 33, 34, 34, 34, 35, 35, 35, 36, 36, 36, 37, 37, 37, 38, 38, 38, 39, 39, 39]
},
{
"name": "angry",
"fps": 1,
"frames": [40, 41, 42, 43, 44, 45, 46, 47]
"frames": [40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47]
},
{
"name": "surprised",
"fps": 1,
"frames": [40, 41, 42, 43, 44, 45, 46, 47]
"frames": [40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47]
},
{
"name": "shy",
"fps": 1,
"frames": [40, 41, 42, 43, 44, 45, 46, 47]
"frames": [40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47]
},
{
"name": "error",
"fps": 1,
"frames": [40, 41, 42, 43, 44, 45, 46, 47]
"frames": [40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47]
},
{
"name": "dragging",

View File

@@ -11,7 +11,7 @@ use tokio::sync::{mpsc, Mutex};
use tracing::warn;
const TAURI_ANIMATION_SLOWDOWN_FACTOR_MIN: u8 = 1;
const TAURI_ANIMATION_SLOWDOWN_FACTOR_MAX: u8 = 20;
const TAURI_ANIMATION_SLOWDOWN_FACTOR_MAX: u8 = 200;
#[derive(Debug, Error)]
pub enum RuntimeCoreError {
@@ -628,6 +628,15 @@ mod tests {
core.frontend_tauri_animation_slowdown_factor().expect("get"),
1
);
let upper = core
.set_frontend_tauri_animation_slowdown_factor(201)
.expect("set high");
assert_eq!(upper, 200);
assert_eq!(
core.frontend_tauri_animation_slowdown_factor().expect("get"),
200
);
}
#[test]

View File

@@ -52,5 +52,5 @@ tauri_animation_slowdown_factor = 3
- `frontend.backend` selects runtime frontend implementation (`bevy` or `tauri`).
- `frontend.debug_overlay_visible` controls whether tauri window debug diagnostics panel is shown.
- `frontend.tauri_animation_slowdown_factor` controls tauri animation pacing multiplier.
valid range: `1..20`
valid range: `1..200`
effective frame interval: `(1000 / clip_fps) * factor`

View File

@@ -145,7 +145,7 @@ An issue touching Tauri runtime behaviors must satisfy all requirements before `
- value persists after restart
5. Change animation speed factor slider and verify:
- runtime animation pace updates immediately in main overlay
- value is clamped to `1..20`
- value is clamped to `1..200`
- value persists after restart via `frontend.tauri_animation_slowdown_factor`
6. Toggle `Visible` and verify:
- main overlay hide/show behavior

View File

@@ -42,7 +42,7 @@ const SCALE_MAX = 3.0;
const LOGICAL_BASE_FRAME_WIDTH = 512;
const LOGICAL_BASE_FRAME_HEIGHT = 512;
const SLOWDOWN_FACTOR_MIN = 1;
const SLOWDOWN_FACTOR_MAX = 20;
const SLOWDOWN_FACTOR_MAX = 200;
const SLOWDOWN_FACTOR_DEFAULT = 3;
async function invokeSetSpritePack(packIdOrPath: string): Promise<UiSnapshot> {
@@ -725,7 +725,8 @@ function SettingsWindow(): JSX.Element {
</label>
<label className="field">
<span>
Animation Speed Factor: x{settings.tauri_animation_slowdown_factor}
Animation Slowdown Factor (higher = slower): x
{settings.tauri_animation_slowdown_factor}
</span>
<input
type="range"

View File

@@ -54,7 +54,7 @@ const HALO_VAL_MIN = 0.04;
const RENDER_FIT_PADDING = 16;
const MIN_RENDER_SCALE = 0.01;
const ANIMATION_SLOWDOWN_FACTOR_MIN = 1;
const ANIMATION_SLOWDOWN_FACTOR_MAX = 20;
const ANIMATION_SLOWDOWN_FACTOR_MAX = 200;
const ANIMATION_SLOWDOWN_FACTOR_DEFAULT = 3;
export class PixiPetRenderer {