@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 +1 -1
- package/src/ui/HtmlTextLayer.js +7 -6
package/package.json
CHANGED
package/src/ui/HtmlTextLayer.js
CHANGED
|
@@ -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
|
-
//
|
|
329
|
-
|
|
330
|
-
const
|
|
331
|
-
const
|
|
332
|
-
const
|
|
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`;
|