mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-21 06:51:01 +01:00
[gpu] Pinch-rotate around pinch center, not screen center
Adds demo_view_rotate_z_around() which compensates translation so the point between the two fingers stays fixed during rotation, like maps apps. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
16c30ac052
commit
c1550337db
5 files changed
+38
-5
No files matched your search
@@ -241,8 +241,11 @@ space: animate · b: dark mode · g: gamma · s: stem · d: debug · r: reset ·
|
||||
if (dAngle < -Math.PI) dAngle += 2 * Math.PI;
|
||||
if (Math.abs(dAngle) > 0.01) {
|
||||
pinchAngle = angle;
|
||||
if (typeof _web_rotate_z === 'function')
|
||||
_web_rotate_z(dAngle);
|
||||
if (typeof _web_rotate_z === 'function') {
|
||||
var mx = (t[0].clientX + t[1].clientX) / 2;
|
||||
var my = (t[0].clientY + t[1].clientY) / 2;
|
||||
_web_rotate_z(dAngle, mx, my, canvas.clientWidth, canvas.clientHeight);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {passive: false});
|
||||
|
||||
Reference in new issue
Block a user