Skip to content

Commit

Permalink
removed direct graph properties that have been previously moved to th…
Browse files Browse the repository at this point in the history
…e general graph properties
  • Loading branch information
NiklasRentzCAU committed Jan 12, 2024
1 parent 0bd5f86 commit fb33953
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 23 deletions.
22 changes: 1 addition & 21 deletions packages/klighd-core/src/skgraph-models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* http://rtsys.informatik.uni-kiel.de/kieler
*
* Copyright 2019-2023 by
* Copyright 2019-2024 by
* + Kiel University
* + Department of Computer Science
* + Real-Time and Embedded Systems Group
Expand Down Expand Up @@ -124,8 +124,6 @@ export interface KStyleHolder {
*/
export interface KRendering extends KGraphData, KStyleHolder {
actions: KAction[]
// not in the original java model, but is included in messages to remove the need to call '[Grid]?PlacementUtil.evaluate[Grid|Area|Point]Placement'
// and similar methods on client side for every rendering

properties: Record<string, unknown>

Expand Down Expand Up @@ -234,9 +232,6 @@ export interface KRoundedRectangle extends KContainerRendering {
*/
export interface KRenderingRef extends KRendering {
rendering: KRendering
// not in the original java model, but is included in messages to remove the need to call 'PlacementUtil.estimateSize' on client side
calculatedBoundsMap: Map<string, Bounds>
calculatedDecorationMap: Map<string, number>
}

/**
Expand All @@ -248,21 +243,6 @@ export interface KText extends KRendering {
text: string
cursorSelectable: boolean
editable: boolean
// Not in the original model, but here to store the precalculated bounds this text alone takes.
/**
* The server pre-calculated bounds for this text.
*/
calculatedTextBounds?: Bounds

/**
* The server pre-calculated line widths for each individual line.
*/
calculatedTextLineWidths?: number[]

/**
* The server pre-calculated line heights for each individual line.
*/
calculatedTextLineHeights?: number[]
}

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/klighd-core/src/views-rendering.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* http://rtsys.informatik.uni-kiel.de/kieler
*
* Copyright 2019-2023 by
* Copyright 2019-2024 by
* + Kiel University
* + Department of Computer Science
* + Real-Time and Embedded Systems Group
Expand Down Expand Up @@ -668,7 +668,7 @@ export function renderKText(
const calculatedTextLineHeights = rendering.properties['klighd.calculated.text.line.heights'] as number[]
let currentY = boundsAndTransformation.bounds.y ?? 0

if (rendering.calculatedTextLineWidths) {
if (calculatedTextLineWidths) {
attrs.lengthAdjust = 'spacingAndGlyphs'
}

Expand Down

0 comments on commit fb33953

Please sign in to comment.