Commit 413f39e
fix: critical rotation bugs from senior review (C1,C2,H1-H4)
C1: sprite_collides_with_bubble_mask now rotates pixel coordinates
before mask lookup. Previously treated rotated sprites as
axis-aligned, causing incorrect font-size fitting for text in
bubbles. Font was too large → text overflowed the bubble.
C2: centred_sprite_transform computes top-left such that the rotated
sprite's visual center lands at the bubble center, instead of
centering the unrotated sprite then rotating around top-left.
Fixes visual center drift for rotated text.
H1: Range slider commits on both onPointerUp AND onBlur. Keyboard
navigation (arrow keys) now reliably triggers rotation updates.
H2: +/- buttons now read from currentDeg (draft-aware) instead of
selectedNode directly. Prevents discarding uncommitted drafts.
H3: Number input handles Escape: clears draft without committing.
H4: updateTransform wrapped in useCallback([page, applyOp,
queueAutoRender]) to avoid stale closure during drag.
Co-authored-by: DeepSeek V4 <deepseek@v4.ai>1 parent dd5f955 commit 413f39e
3 files changed
Lines changed: 63 additions & 43 deletions
File tree
- crates/koharu-app/src
- ui/components
- canvas
- panels
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
712 | 712 | | |
713 | 713 | | |
714 | 714 | | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
715 | 719 | | |
716 | 720 | | |
717 | 721 | | |
718 | 722 | | |
719 | | - | |
720 | | - | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
721 | 727 | | |
722 | 728 | | |
723 | 729 | | |
| |||
993 | 999 | | |
994 | 1000 | | |
995 | 1001 | | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
996 | 1012 | | |
997 | | - | |
998 | | - | |
| 1013 | + | |
| 1014 | + | |
999 | 1015 | | |
1000 | 1016 | | |
1001 | 1017 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
71 | 74 | | |
72 | 75 | | |
73 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
382 | 396 | | |
383 | 397 | | |
384 | 398 | | |
| |||
816 | 830 | | |
817 | 831 | | |
818 | 832 | | |
819 | | - | |
820 | | - | |
821 | | - | |
| 833 | + | |
822 | 834 | | |
823 | 835 | | |
824 | 836 | | |
| |||
842 | 854 | | |
843 | 855 | | |
844 | 856 | | |
845 | | - | |
846 | | - | |
847 | | - | |
848 | | - | |
849 | | - | |
850 | | - | |
851 | | - | |
| 857 | + | |
| 858 | + | |
852 | 859 | | |
853 | 860 | | |
854 | 861 | | |
| |||
864 | 871 | | |
865 | 872 | | |
866 | 873 | | |
867 | | - | |
868 | | - | |
869 | | - | |
870 | | - | |
871 | | - | |
872 | | - | |
873 | | - | |
| 874 | + | |
874 | 875 | | |
875 | 876 | | |
876 | 877 | | |
| 878 | + | |
| 879 | + | |
877 | 880 | | |
878 | 881 | | |
879 | 882 | | |
| |||
887 | 890 | | |
888 | 891 | | |
889 | 892 | | |
890 | | - | |
891 | | - | |
892 | | - | |
| 893 | + | |
893 | 894 | | |
894 | 895 | | |
895 | 896 | | |
| |||
0 commit comments