[Merge] Merged changes from master before further implementations

This commit is contained in:
Carl Fuchs 2023-02-20 10:31:52 +01:00
parent d72c2266f3
commit 6b6175a521
3 changed files with 14 additions and 42 deletions

View file

@ -182,6 +182,7 @@ function AddHorizontalSymbolDimension(symbol: ISymbolModel,
const width = symbol.offset + (symbol.width / 2);
if (width != null && width > 0) {
const id = `dim-y-margin-left${symbol.width.toFixed(0)}-${symbol.id}`;
const style = symbol.linkedContainers.values().next().value.dimensionOptions;
const offset = (DIMENSION_MARGIN * (depth + 1)) / scale;
const text = width
@ -197,7 +198,7 @@ function AddHorizontalSymbolDimension(symbol: ISymbolModel,
yEnd={-offset}
text={text}
scale={scale}
color={color}/>
style={style}/>
);
}
}
@ -211,6 +212,7 @@ function AddVerticalSymbolDimension(symbol: ISymbolModel,
const height = symbol.offset + (symbol.height / 2);
if (height != null && height > 0) {
const id = `dim-x-margin-left${symbol.height.toFixed(0)}-${symbol.id}`;
const style = symbol.linkedContainers.values().next().value.dimensionOptions;
const offset = (DIMENSION_MARGIN * (depth + 1)) / scale;
const text = height
@ -226,7 +228,7 @@ function AddVerticalSymbolDimension(symbol: ISymbolModel,
yEnd={0}
text={text}
scale={scale}
color={color}/>
style={style}/>
);
}
}
@ -680,40 +682,3 @@ function AddVerticalSelfMarginDimension(
);
}
}
function AddHorizontalSymbolDimension(
symbol: ISymbolModel,
dimensions: React.ReactNode[],
scale: number,
depth: number
): void {
const width = symbol.x + (symbol.width / 2);
if (width == null || width <= 0) {
return;
}
const id = `dim-y-margin-left${symbol.width.toFixed(0)}-${symbol.id}`;
const offset = (DIMENSION_MARGIN * (depth + 1)) / scale;
const text = width
.toFixed(0)
.toString();
// TODO: Put this in default.ts
const defaultDimensionSymbolStyle: IDimensionStyle = {
color: 'black'
};
dimensions.push(
<Dimension
key={id}
id={id}
xStart={0}
yStart={-offset}
xEnd={width}
yEnd={-offset}
text={text}
scale={scale}
style={defaultDimensionSymbolStyle}/>
);
}