@sequent-org/moodboard 1.2.99 → 1.2.100

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sequent-org/moodboard",
3
- "version": "1.2.99",
3
+ "version": "1.2.100",
4
4
  "type": "module",
5
5
  "description": "Interactive moodboard",
6
6
  "main": "./src/index.js",
@@ -324,12 +324,13 @@ export class HtmlTextLayer {
324
324
  // Преобразуем мировые координаты в экранные через toGlobal
325
325
  const tl = worldLayer.toGlobal(new PIXI.Point(x, y));
326
326
  const br = worldLayer.toGlobal(new PIXI.Point(x + w, y + h));
327
-
328
- // CSS координаты с учетом offset
329
- const left = offsetLeft + tl.x;
330
- const top = offsetTop + tl.y;
331
- const width = Math.max(1, br.x - tl.x);
332
- const height = Math.max(1, br.y - tl.y);
327
+
328
+ // toGlobal() возвращает координаты в device-пикселях с учётом resolution.
329
+ // Для CSS нам нужны логические пиксели, поэтому делим на res.
330
+ const left = offsetLeft + tl.x / res;
331
+ const top = offsetTop + tl.y / res;
332
+ const width = Math.max(1, (br.x - tl.x) / res);
333
+ const height = Math.max(1, (br.y - tl.y) / res);
333
334
 
334
335
  // Применяем к элементу
335
336
  el.style.left = `${left}px`;