@fmsim/machine 2.0.0-beta.108 → 2.0.0-beta.109

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
@@ -2,7 +2,7 @@
2
2
  "name": "@fmsim/machine",
3
3
  "description": "Layout View를 구성하는 설비(machine)들과 유닛을 구현한 모듈입니다.",
4
4
  "author": "heartyoh",
5
- "version": "2.0.0-beta.108",
5
+ "version": "2.0.0-beta.109",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
8
8
  "things-scene": true,
@@ -55,5 +55,5 @@
55
55
  "prettier --write"
56
56
  ]
57
57
  },
58
- "gitHead": "43c0f7478a658e01ec5147bac7bf26f18a35536b"
58
+ "gitHead": "58415fb96b1e2e0f33b2e3da8a11a5317ce7819d"
59
59
  }
@@ -73,6 +73,11 @@ export default class CarrierManager {
73
73
  }
74
74
  }
75
75
 
76
+ // showText 는 *현재 소유 홀더* 의 showCarrierText 를 항상 따른다 — 생성 시점에만
77
+ // 고정하면 동일 이름 carrier 가 다른 홀더(예: 분체 Crane)로 이동/보고될 때
78
+ // off 를 무시하고 표시(F/E/X)가 남는다. 매 update 마다 재동기화한다.
79
+ const showCarrierText = holder.getState('showCarrierText') || false
80
+
76
81
  // 2) afterStack 의 *순서대로* 처리 — bottom (ADDITIONS[0]) 부터 top (대표)
77
82
  // 그래야 parent.components 가 자연스럽게 같은 순서로 정렬되어 stack index
78
83
  // 가 일관된다.
@@ -92,7 +97,7 @@ export default class CarrierManager {
92
97
  top: 0,
93
98
  width,
94
99
  height,
95
- showText: holder.getState('showCarrierText') || false,
100
+ showText: showCarrierText,
96
101
  stackIndex: idx
97
102
  },
98
103
  this.root.app
@@ -110,6 +115,9 @@ export default class CarrierManager {
110
115
 
111
116
  if (carrier.parent === holder) {
112
117
  carrier.setState('stackIndex', idx)
118
+ // showText 는 *값이 바뀔 때만* setState — 매 프레임 불필요한 onchange / 3D mesh
119
+ // 재빌드를 원천 차단(성능). 평시(변화 없음)엔 getState 비교 한 번으로 끝난다.
120
+ if (carrier.getState('showText') !== showCarrierText) carrier.setState('showText', showCarrierText)
113
121
  carrier.data = item
114
122
  }
115
123
  })
@@ -387,7 +387,8 @@ class MCSRealObject3D extends RealObjectGroup {
387
387
  'strokeStyle' in after ||
388
388
  'id' in after ||
389
389
  'EMPTYTYPE' in after ||
390
- 'CARRIERSTATUS' in after
390
+ 'CARRIERSTATUS' in after ||
391
+ 'showText' in after
391
392
  ) {
392
393
  // 연속 setState에 의한 다중 rebuild 방지: 한 프레임에 한 번만 실행
393
394
  if (!this._updatePending) {
@@ -427,8 +428,9 @@ class MCSRealObject3D extends RealObjectGroup {
427
428
  ctx.fillStyle = statusColor
428
429
  ctx.fillRect(0, 0, usedW, usedH)
429
430
 
430
- // 텍스트 (사용 영역 중앙)
431
- if (text) {
431
+ // 텍스트 (사용 영역 중앙) — showText(= 현재 홀더의 showCarrierText) off 면 미표시. 2D 와 동일.
432
+ const showText = !!(this.component.state as any)?.showText
433
+ if (text && showText) {
432
434
  const fontSize = Math.round(Math.min(usedW, usedH) * 0.7)
433
435
  ctx.font = `bold ${fontSize}px Arial`
434
436
  ctx.textAlign = 'center'