fitPlanLabel
Function in @bimworks/viewercommon.
API catalogue · @bimworks/viewercommon · Function
TypeScript#
function fitPlanLabelMembers#
| Member | Kind | Description |
|---|---|---|
| fitPlanLabel | Method | Whether a block of text fits into an object in a plan, and where it goes: the rectangle rule when the object fills its rectangle, the circle rule otherwise (… |
fitPlanLabel#
TypeScript#
fitPlanLabel(block: { lineHeight: number; lineWidths: (number)[] }, k: number, bx: number, by: number, shape: { circle: PlanCircle | null; rect: PlanRectangle | null }, shownLines: number, dropLines: boolean, out: { lines?: number; rule?: string | null; x?: number; y?: number }): { lines: number; rule: string | null; x: number; y: number }Whether a block of text fits into an object in a plan, and where it goes: the rectangle rule when the object fills its rectangle, the circle rule otherwise (Viewer3D/docs/plan-labels-design.md §6). k is pixels per millimetre along the baseline (bx, by); out.lines is the number of lines shown, 0 when the label does not fit.
Parameters#
| Name | Type | Description |
|---|---|---|
block |
{ lineHeight: number; lineWidths: (number)[] } |
|
k |
number |
|
bx |
number |
|
by |
number |
|
shape |
{ circle: PlanCircle | null; rect: PlanRectangle | null } |
|
shownLines |
number |
|
dropLines |
boolean |
|
out |
{ lines?: number; rule?: string | null; x?: number; y?: number } |