Skip to content

Commit 63476f8

Browse files
adjust error scroll mouse
1 parent 0603d26 commit 63476f8

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

dist/lib.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4179,7 +4179,7 @@ const Au = /* @__PURE__ */ ga(gH), yH = $r(), mH = Ls.create({
41794179
(L.y - r.y) / N
41804180
);
41814181
W < 0.05 && (W = 0.05), W > 10 && (W = 10);
4182-
const ne = kH().translate(r.x, r.y).scaleU(W);
4182+
const ne = kH().translate(r.x, r.y).scaleU(W).translate(-r.x, -r.y);
41834183
t(ne.clone());
41844184
}
41854185
i(null), a(null);

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@amnstak/react-image-annotate",
2+
"name": "@scarlex/react-image-annotate",
33
"version": "0.0.23",
44
"type": "module",
55
"main": "dist/lib.js",
@@ -91,7 +91,7 @@
9191
},
9292
"repository": {
9393
"type": "git",
94-
"url": "git+https://github.com/aman1tagic/react-image-annotate.git"
94+
"url": "git+https://github.com/GarnesPratama/react-image-annotation.git"
9595
},
9696
"scripts": {
9797
"start": "vite --force",

src/ImageCanvas/use-mouse.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,11 @@ export default ({
174174
if (scale < 0.05) scale = 0.05;
175175
if (scale > 10) scale = 10;
176176

177+
// Terapkan transform baru (uniform scaling + center zoom)
177178
const newMat = getDefaultMat()
178179
.translate(zoomStart.x, zoomStart.y)
179-
.scaleU(scale);
180+
.scaleU(scale)
181+
.translate(-zoomStart.x, -zoomStart.y);
180182

181183
changeMat(newMat.clone());
182184
}

0 commit comments

Comments
 (0)