@sequent-org/moodboard 1.2.102 → 1.2.103

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.102",
3
+ "version": "1.2.103",
4
4
  "type": "module",
5
5
  "description": "Interactive moodboard",
6
6
  "main": "./src/index.js",
@@ -325,12 +325,15 @@ export class HtmlTextLayer {
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
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);
328
+ // ВАЖНО: toGlobal() уже возвращает координаты в логических экранных пикселях
329
+ // (как и для HtmlHandlesLayer), поэтому делить их на renderer.resolution
330
+ // при вычислении CSS-позиции и размеров не нужно. Деление приводило к тому,
331
+ // что при res < 1 (масштаб браузера ≠ 100%) HTML-текст уезжал относительно
332
+ // собственных рамок и PIXI-объекта.
333
+ const left = offsetLeft + tl.x;
334
+ const top = offsetTop + tl.y;
335
+ const width = Math.max(1, (br.x - tl.x));
336
+ const height = Math.max(1, (br.y - tl.y));
334
337
 
335
338
  // Применяем к элементу
336
339
  el.style.left = `${left}px`;