@expofp/renderer 3.47.1 → 3.48.0

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.
@@ -2,7 +2,7 @@ import { TextImpl } from '../../core/text/Text';
2
2
  import { sameSequence } from '../../utils/arrays';
3
3
  import { SlotContainer } from '../containers';
4
4
  import { isDimmed } from '../materials/effects/color-dim';
5
- import { LAYOUT_FONT_SIZE, LINE_HEIGHT } from './text-layout';
5
+ import { LAYOUT_FONT_SIZE } from './text-layout';
6
6
  /**
7
7
  * One text layer's bookkeeping: a group of members per def, and the paint order across them.
8
8
  *
@@ -219,7 +219,8 @@ export class TextContainer extends SlotContainer {
219
219
  function makeMember() {
220
220
  const text = new TextImpl();
221
221
  text.fontSize = LAYOUT_FONT_SIZE;
222
- text.lineHeight = LINE_HEIGHT;
222
+ // One em per row, so a line box is its font size: text-layout stacks lines on that.
223
+ text.lineHeight = 1;
223
224
  // Wrapping is the floorplan's job: it measures and breaks lines itself, then hands over the
224
225
  // result with explicit newlines. Letting troika re-wrap on top would fight that.
225
226
  text.whiteSpace = 'nowrap';
@@ -13,8 +13,6 @@ import { type TextDef, type TextLineDef } from '../../types/defs';
13
13
  * an em and every scale below would have to carry a compensating factor of ten.
14
14
  */
15
15
  export declare const LAYOUT_FONT_SIZE = 1;
16
- /** Line box height as a multiple of the font size, matching the `lineHeight` members are given. */
17
- export declare const LINE_HEIGHT = 1.1;
18
16
  /**
19
17
  * A line's placement **in its def's own unrotated frame**, as an offset from the bounds' center.
20
18
  *
@@ -11,8 +11,6 @@ import { Vector2 } from 'three';
11
11
  * an em and every scale below would have to carry a compensating factor of ten.
12
12
  */
13
13
  export const LAYOUT_FONT_SIZE = 1;
14
- /** Line box height as a multiple of the font size, matching the `lineHeight` members are given. */
15
- export const LINE_HEIGHT = 1.1;
16
14
  /**
17
15
  * Stacks a text def's lines inside its bounds, aligned as the def asks.
18
16
  *
@@ -142,7 +140,7 @@ export function applyPlacement(text, line, bounds, screenSpace) {
142
140
  * @returns The height, in plan units.
143
141
  */
144
142
  export function lineHeight(line) {
145
- return line.fontSize * LINE_HEIGHT * line.text.split('\n').length;
143
+ return line.fontSize * line.text.split('\n').length;
146
144
  }
147
145
  /**
148
146
  * Which way each axis is offset from the bounds' center for a given alignment.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expofp/renderer",
3
- "version": "3.47.1",
3
+ "version": "3.48.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/expofp/efp-app.git",
@@ -42,7 +42,7 @@
42
42
  "troika-three-text": "^0.52.5",
43
43
  "tslib": "^2.3.0",
44
44
  "webgl-memory": "^1.1.3",
45
- "@expofp/geometry": "3.47.1"
45
+ "@expofp/geometry": "3.48.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@react-three/test-renderer": "^9.1.0",