circuitscript 0.5.4 → 0.5.6
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/README.md +105 -2
- package/dist/cjs/BaseVisitor.js +11 -10
- package/dist/cjs/builtinMethods.js +6 -5
- package/dist/cjs/environment/environment.js +2 -2
- package/dist/cjs/errors.js +140 -0
- package/dist/cjs/execute.js +12 -5
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/main.js +3 -2
- package/dist/cjs/objects/ClassComponent.js +4 -4
- package/dist/cjs/objects/ExecutionScope.js +2 -2
- package/dist/cjs/objects/NumericValue.js +15 -0
- package/dist/cjs/objects/PinDefinition.js +2 -2
- package/dist/cjs/objects/types.js +2 -2
- package/dist/cjs/parser.js +3 -2
- package/dist/cjs/pipeline.js +21 -14
- package/dist/cjs/regenerate-tests.js +6 -6
- package/dist/cjs/render/draw_symbols.js +17 -17
- package/dist/cjs/render/geometry.js +6 -6
- package/dist/cjs/render/layout.js +325 -253
- package/dist/cjs/render/render.js +21 -18
- package/dist/cjs/semantic-tokens/getSemanticTokens.js +2 -2
- package/dist/cjs/sizing.js +2 -2
- package/dist/cjs/utils.js +13 -110
- package/dist/cjs/validate/validateScript.js +2 -2
- package/dist/cjs/visitor.js +14 -12
- package/dist/esm/BaseVisitor.js +2 -1
- package/dist/esm/builtinMethods.js +6 -5
- package/dist/esm/environment/environment.js +1 -1
- package/dist/esm/errors.js +119 -0
- package/dist/esm/execute.js +10 -3
- package/dist/esm/index.js +1 -0
- package/dist/esm/main.js +3 -2
- package/dist/esm/objects/ClassComponent.js +1 -1
- package/dist/esm/objects/ExecutionScope.js +1 -1
- package/dist/esm/objects/NumericValue.js +15 -0
- package/dist/esm/objects/PinDefinition.js +1 -1
- package/dist/esm/objects/types.js +1 -1
- package/dist/esm/parser.js +2 -1
- package/dist/esm/pipeline.js +10 -3
- package/dist/esm/regenerate-tests.js +6 -6
- package/dist/esm/render/draw_symbols.js +15 -15
- package/dist/esm/render/geometry.js +6 -6
- package/dist/esm/render/layout.js +325 -253
- package/dist/esm/render/render.js +22 -19
- package/dist/esm/semantic-tokens/getSemanticTokens.js +1 -1
- package/dist/esm/sizing.js +2 -2
- package/dist/esm/utils.js +10 -95
- package/dist/esm/validate/validateScript.js +1 -1
- package/dist/esm/visitor.js +4 -2
- package/dist/libs/std.cst +31 -31
- package/dist/types/BaseVisitor.d.ts +3 -1
- package/dist/types/errors.d.ts +37 -0
- package/dist/types/execute.d.ts +1 -1
- package/dist/types/helpers.d.ts +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/objects/NumericValue.d.ts +5 -1
- package/dist/types/render/geometry.d.ts +4 -4
- package/dist/types/render/layout.d.ts +7 -1
- package/dist/types/utils.d.ts +2 -27
- package/dist/types/visitor.d.ts +1 -1
- package/libs/std.cst +31 -31
- package/package.json +5 -2
package/dist/cjs/pipeline.js
CHANGED
|
@@ -21,6 +21,7 @@ const rules_js_1 = require("./rules-check/rules.js");
|
|
|
21
21
|
const utils_js_1 = require("./utils.js");
|
|
22
22
|
const visitor_js_1 = require("./visitor.js");
|
|
23
23
|
const styles_js_1 = require("./styles.js");
|
|
24
|
+
const errors_js_1 = require("./errors.js");
|
|
24
25
|
async function renderScript(scriptData, outputPath, options) {
|
|
25
26
|
const parseHandlers = [
|
|
26
27
|
new KiCadNetListOutputHandler_js_1.KiCadNetListOutputHandler(),
|
|
@@ -32,28 +33,28 @@ async function renderScriptCustom(scriptData, outputPath, options, parseHandlers
|
|
|
32
33
|
const { dumpNets = false, dumpData = false, showStats = false, enableErc = false, enableBom = false, lexerDiagnostics = false, lexerVerbose = false, lexerTokens = false, lexerMapping = false, lexerSummary = false, inputPath = '', bomOutputPath = undefined, environment } = options;
|
|
33
34
|
const errors = [];
|
|
34
35
|
const onErrorHandler = (message, context, error) => {
|
|
35
|
-
if (error && error instanceof
|
|
36
|
+
if (error && error instanceof errors_js_1.RuntimeExecutionError) {
|
|
36
37
|
errors.push(error);
|
|
37
38
|
}
|
|
38
39
|
else if (error && error instanceof antlr4ng_1.RecognitionException) {
|
|
39
40
|
if (context !== null) {
|
|
40
|
-
errors.push(new
|
|
41
|
+
errors.push(new errors_js_1.ParseSyntaxError(message, context.start, context.stop));
|
|
41
42
|
}
|
|
42
43
|
else {
|
|
43
44
|
if (error.recognizer) {
|
|
44
45
|
const recognizer = error.recognizer;
|
|
45
|
-
errors.push(new
|
|
46
|
+
errors.push(new errors_js_1.ParseSyntaxError(message, {
|
|
46
47
|
line: recognizer.currentTokenStartLine,
|
|
47
48
|
column: recognizer.currentTokenColumn
|
|
48
49
|
}));
|
|
49
50
|
}
|
|
50
51
|
else {
|
|
51
|
-
errors.push(new
|
|
52
|
+
errors.push(new errors_js_1.ParseSyntaxError(message));
|
|
52
53
|
}
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
else {
|
|
56
|
-
errors.push(new
|
|
57
|
+
errors.push(new errors_js_1.ParseError(message, context.start, context.stop));
|
|
57
58
|
}
|
|
58
59
|
};
|
|
59
60
|
const visitor = new visitor_js_1.ParserVisitor(true, onErrorHandler, environment);
|
|
@@ -79,7 +80,7 @@ async function renderScriptCustom(scriptData, outputPath, options, parseHandlers
|
|
|
79
80
|
if (throwError) {
|
|
80
81
|
importErrorMsg = ": " + throwError.message;
|
|
81
82
|
}
|
|
82
|
-
throw new
|
|
83
|
+
throw new errors_js_1.ParseError(`Error parsing imported file: ${filePath}${importErrorMsg}`, undefined, undefined, filePath);
|
|
83
84
|
}
|
|
84
85
|
return { hasError, hasParseError, tree, tokens };
|
|
85
86
|
};
|
|
@@ -141,7 +142,7 @@ async function renderScriptCustom(scriptData, outputPath, options, parseHandlers
|
|
|
141
142
|
visitor.annotateComponents();
|
|
142
143
|
}
|
|
143
144
|
catch (err) {
|
|
144
|
-
throw new
|
|
145
|
+
throw new errors_js_1.RenderError(`Error during component annotation: ${err}`, 'annotation');
|
|
145
146
|
}
|
|
146
147
|
const componentLinks = visitor.getComponentCtxLinks();
|
|
147
148
|
const importedLibraries = Array.from(visitor.getScope().libraries.values());
|
|
@@ -215,7 +216,13 @@ async function renderScriptCustom(scriptData, outputPath, options, parseHandlers
|
|
|
215
216
|
}
|
|
216
217
|
}
|
|
217
218
|
catch (err) {
|
|
218
|
-
|
|
219
|
+
let useErr = err;
|
|
220
|
+
if (err instanceof errors_js_1.AutoWireFailedError_) {
|
|
221
|
+
const errCtx = visitor.wireCtxLinks.get(err.wire);
|
|
222
|
+
useErr = new errors_js_1.AutoWireFailedError(err.message, errCtx.start, errCtx.stop);
|
|
223
|
+
}
|
|
224
|
+
dumpData && environment.writeFileSync(dumpDirectory + 'raw-layout.txt', layoutEngine.logger.dump());
|
|
225
|
+
throw new errors_js_1.RenderError(`Error during layout generation`, 'layout', { cause: useErr });
|
|
219
226
|
}
|
|
220
227
|
layoutEngine.printWarnings();
|
|
221
228
|
showStats && console.log('Layout took:', layoutTimer.lap());
|
|
@@ -227,7 +234,7 @@ async function renderScriptCustom(scriptData, outputPath, options, parseHandlers
|
|
|
227
234
|
svgCanvas = (0, render_js_1.renderSheetsToSVG)(sheetFrames, renderLogger, documentVariable, styles);
|
|
228
235
|
}
|
|
229
236
|
catch (err) {
|
|
230
|
-
throw new
|
|
237
|
+
throw new errors_js_1.RenderError(`Error during SVG generation: ${err}`, 'svg_generation');
|
|
231
238
|
}
|
|
232
239
|
showStats && console.log('Render took:', generateSvgTimer.lap());
|
|
233
240
|
dumpData && environment.writeFileSync(dumpDirectory + 'raw-render.txt', renderLogger.dump());
|
|
@@ -238,7 +245,7 @@ async function renderScriptCustom(scriptData, outputPath, options, parseHandlers
|
|
|
238
245
|
svgOutput = (0, render_js_1.generateSvgOutput)(svgCanvas, outputDefaultZoom);
|
|
239
246
|
}
|
|
240
247
|
catch (err) {
|
|
241
|
-
throw new
|
|
248
|
+
throw new errors_js_1.RenderError(`Error generating SVG output: ${err}`, 'svg_output');
|
|
242
249
|
}
|
|
243
250
|
if (outputPath) {
|
|
244
251
|
if (fileExtension === 'svg') {
|
|
@@ -246,7 +253,7 @@ async function renderScriptCustom(scriptData, outputPath, options, parseHandlers
|
|
|
246
253
|
environment.writeFileSync(outputPath, svgOutput);
|
|
247
254
|
}
|
|
248
255
|
catch (err) {
|
|
249
|
-
throw new
|
|
256
|
+
throw new errors_js_1.RenderError(`Error writing SVG file: ${err}`, 'file_output');
|
|
250
257
|
}
|
|
251
258
|
}
|
|
252
259
|
else if (fileExtension === 'pdf') {
|
|
@@ -267,17 +274,17 @@ async function renderScriptCustom(scriptData, outputPath, options, parseHandlers
|
|
|
267
274
|
doc.end();
|
|
268
275
|
}
|
|
269
276
|
catch (err) {
|
|
270
|
-
throw new
|
|
277
|
+
throw new errors_js_1.RenderError(`Error generating PDF file: ${err}`, 'pdf_output');
|
|
271
278
|
}
|
|
272
279
|
}
|
|
273
280
|
else {
|
|
274
|
-
throw new
|
|
281
|
+
throw new errors_js_1.RenderError(`Invalid output format: ${fileExtension}`, 'file_output');
|
|
275
282
|
}
|
|
276
283
|
console.log('Generated file', outputPath);
|
|
277
284
|
}
|
|
278
285
|
}
|
|
279
286
|
catch (err) {
|
|
280
|
-
throw new
|
|
287
|
+
throw new errors_js_1.RenderError(`Error during rendering: ${err}`, 'output_generation', { cause: err });
|
|
281
288
|
}
|
|
282
289
|
}
|
|
283
290
|
return {
|
|
@@ -45,14 +45,14 @@ async function regenerateTests(extra = "") {
|
|
|
45
45
|
cstFiles.forEach(file => {
|
|
46
46
|
const svg1 = 'svgs/' + file + '.svg';
|
|
47
47
|
const svg2 = 'svgs/' + file + '.next.svg';
|
|
48
|
-
const cleanedName = file.replace('script', '')
|
|
49
|
-
|
|
48
|
+
const cleanedName = file.replace('script', '')
|
|
49
|
+
.replace('.cst', '')
|
|
50
|
+
.replace('.annotated', '');
|
|
51
|
+
allFiles.push([file, svg1, svg2, Number(cleanedName)]);
|
|
50
52
|
});
|
|
51
53
|
const sortedFiles = allFiles.sort((a, b) => {
|
|
52
|
-
const
|
|
53
|
-
const
|
|
54
|
-
const indexA = Number(nameA);
|
|
55
|
-
const indexB = Number(nameB);
|
|
54
|
+
const indexA = a[3];
|
|
55
|
+
const indexB = b[3];
|
|
56
56
|
if (indexA > indexB) {
|
|
57
57
|
return 1;
|
|
58
58
|
}
|
|
@@ -5,7 +5,7 @@ const helpers_js_1 = require("../helpers.js");
|
|
|
5
5
|
const globals_js_1 = require("../globals.js");
|
|
6
6
|
const geometry_js_1 = require("./geometry.js");
|
|
7
7
|
const PinTypes_js_1 = require("../objects/PinTypes.js");
|
|
8
|
-
const
|
|
8
|
+
const errors_js_1 = require("../errors.js");
|
|
9
9
|
const types_js_1 = require("../objects/types.js");
|
|
10
10
|
const NumericValue_js_1 = require("../objects/NumericValue.js");
|
|
11
11
|
const PinDefinition_js_1 = require("../objects/PinDefinition.js");
|
|
@@ -88,7 +88,7 @@ class SymbolGraphic {
|
|
|
88
88
|
pinPosition(id) {
|
|
89
89
|
const pin = this.drawing.getPinPosition(id);
|
|
90
90
|
if (pin === null) {
|
|
91
|
-
throw new
|
|
91
|
+
throw new errors_js_1.RuntimeExecutionError(`Could not determine pin ${id} position`);
|
|
92
92
|
}
|
|
93
93
|
const [x, y] = pin.start;
|
|
94
94
|
const useX = (0, NumericValue_js_1.roundValue)(x);
|
|
@@ -154,7 +154,7 @@ class SymbolGraphic {
|
|
|
154
154
|
}
|
|
155
155
|
const isHorizontalLabel = finalLabelAngle === 0 || finalLabelAngle === 180;
|
|
156
156
|
const isVerticalLabel = finalLabelAngle === 90 || finalLabelAngle === -90;
|
|
157
|
-
if (useAnchor === geometry_js_1.HorizontalAlign.
|
|
157
|
+
if (useAnchor === geometry_js_1.HorizontalAlign.Center) {
|
|
158
158
|
anchorStyle = geometry_js_1.HorizontalAlignProp.Middle;
|
|
159
159
|
}
|
|
160
160
|
else if (useAnchor === geometry_js_1.HorizontalAlign.Left) {
|
|
@@ -163,7 +163,7 @@ class SymbolGraphic {
|
|
|
163
163
|
else if (useAnchor === geometry_js_1.HorizontalAlign.Right) {
|
|
164
164
|
anchorStyle = geometry_js_1.HorizontalAlignProp.End;
|
|
165
165
|
}
|
|
166
|
-
if (useDominantBaseline === geometry_js_1.VerticalAlign.
|
|
166
|
+
if (useDominantBaseline === geometry_js_1.VerticalAlign.Center) {
|
|
167
167
|
dominantBaseline = geometry_js_1.VerticalAlignProp.Central;
|
|
168
168
|
}
|
|
169
169
|
else if (useDominantBaseline === geometry_js_1.VerticalAlign.Top) {
|
|
@@ -331,7 +331,7 @@ class SymbolGraphic {
|
|
|
331
331
|
return geometry_js_1.HorizontalAlign.Left;
|
|
332
332
|
}
|
|
333
333
|
else {
|
|
334
|
-
return geometry_js_1.HorizontalAlign.
|
|
334
|
+
return geometry_js_1.HorizontalAlign.Center;
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
337
|
flipDominantBaseline(value) {
|
|
@@ -342,7 +342,7 @@ class SymbolGraphic {
|
|
|
342
342
|
return geometry_js_1.VerticalAlign.Top;
|
|
343
343
|
}
|
|
344
344
|
else {
|
|
345
|
-
return geometry_js_1.VerticalAlign.
|
|
345
|
+
return geometry_js_1.VerticalAlign.Center;
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
348
|
}
|
|
@@ -359,7 +359,7 @@ class SymbolText extends SymbolGraphic {
|
|
|
359
359
|
drawing.clear();
|
|
360
360
|
drawing.addTextbox((0, NumericValue_js_1.numeric)(0), (0, NumericValue_js_1.numeric)(0), this.text, {
|
|
361
361
|
fontSize: this.fontSize,
|
|
362
|
-
anchor: geometry_js_1.HorizontalAlign.
|
|
362
|
+
anchor: geometry_js_1.HorizontalAlign.Center,
|
|
363
363
|
fontWeight: this.fontWeight,
|
|
364
364
|
});
|
|
365
365
|
this.drawing = drawing;
|
|
@@ -469,7 +469,7 @@ class SymbolPlaceholder extends SymbolGraphic {
|
|
|
469
469
|
drawing.addLabelMils(...tmpPositionParams);
|
|
470
470
|
}
|
|
471
471
|
catch (err) {
|
|
472
|
-
(0,
|
|
472
|
+
(0, errors_js_1.throwWithContext)(ctx, err);
|
|
473
473
|
}
|
|
474
474
|
break;
|
|
475
475
|
}
|
|
@@ -647,7 +647,7 @@ class SymbolPlaceholder extends SymbolGraphic {
|
|
|
647
647
|
displayPinName && usePinName !== "" && drawing.addLabel(endX.add(pinNameOffsetX), endY.add(pinNameOffsetY), usePinName, {
|
|
648
648
|
fontSize: (0, NumericValue_js_1.numeric)(globals_js_1.defaultPinNameTextSize),
|
|
649
649
|
anchor: pinNameAlignment,
|
|
650
|
-
vanchor: geometry_js_1.VerticalAlign.
|
|
650
|
+
vanchor: geometry_js_1.VerticalAlign.Center,
|
|
651
651
|
textColor: pinNameColor,
|
|
652
652
|
angle: (0, NumericValue_js_1.numeric)(usePinIdAngle)
|
|
653
653
|
});
|
|
@@ -760,7 +760,7 @@ class SymbolCustom extends SymbolGraphic {
|
|
|
760
760
|
drawing.addLabel(leftPinStart.add((0, helpers_js_1.milsToMM)(20)), pinY, pin.text, {
|
|
761
761
|
fontSize: (0, NumericValue_js_1.numeric)(globals_js_1.CustomSymbolPinTextSize),
|
|
762
762
|
anchor: geometry_js_1.HorizontalAlign.Left,
|
|
763
|
-
vanchor: geometry_js_1.VerticalAlign.
|
|
763
|
+
vanchor: geometry_js_1.VerticalAlign.Center,
|
|
764
764
|
textColor: globals_js_1.ColorScheme.PinNameColor,
|
|
765
765
|
});
|
|
766
766
|
drawing.addLabel(leftPinStart.sub((0, helpers_js_1.milsToMM)(10)), pinY.sub((0, helpers_js_1.milsToMM)(10)), pin.pinId.toString(), {
|
|
@@ -777,7 +777,7 @@ class SymbolCustom extends SymbolGraphic {
|
|
|
777
777
|
drawing.addLabel(rightPinStart.sub((0, helpers_js_1.milsToMM)(20)), pinY, pin.text, {
|
|
778
778
|
fontSize: (0, NumericValue_js_1.numeric)(globals_js_1.CustomSymbolPinTextSize),
|
|
779
779
|
anchor: geometry_js_1.HorizontalAlign.Right,
|
|
780
|
-
vanchor: geometry_js_1.VerticalAlign.
|
|
780
|
+
vanchor: geometry_js_1.VerticalAlign.Center,
|
|
781
781
|
textColor: globals_js_1.ColorScheme.PinNameColor,
|
|
782
782
|
});
|
|
783
783
|
drawing.addLabel(rightPinStart.add((0, helpers_js_1.milsToMM)(10)), pinY.sub((0, helpers_js_1.milsToMM)(10)), pin.pinId.toString(), {
|
|
@@ -794,7 +794,7 @@ class SymbolCustom extends SymbolGraphic {
|
|
|
794
794
|
drawing.addLabel(pinX, topPinStart.add((0, helpers_js_1.milsToMM)(20)), pin.text, {
|
|
795
795
|
fontSize: (0, NumericValue_js_1.numeric)(globals_js_1.CustomSymbolPinTextSize),
|
|
796
796
|
anchor: geometry_js_1.HorizontalAlign.Right,
|
|
797
|
-
vanchor: geometry_js_1.VerticalAlign.
|
|
797
|
+
vanchor: geometry_js_1.VerticalAlign.Center,
|
|
798
798
|
textColor: globals_js_1.ColorScheme.PinNameColor,
|
|
799
799
|
angle: (0, NumericValue_js_1.numeric)(-90),
|
|
800
800
|
});
|
|
@@ -813,7 +813,7 @@ class SymbolCustom extends SymbolGraphic {
|
|
|
813
813
|
drawing.addLabel(pinX, bottomPinStart.sub((0, helpers_js_1.milsToMM)(20)), pin.text, {
|
|
814
814
|
fontSize: (0, NumericValue_js_1.numeric)(globals_js_1.CustomSymbolPinTextSize),
|
|
815
815
|
anchor: geometry_js_1.HorizontalAlign.Left,
|
|
816
|
-
vanchor: geometry_js_1.VerticalAlign.
|
|
816
|
+
vanchor: geometry_js_1.VerticalAlign.Center,
|
|
817
817
|
textColor: globals_js_1.ColorScheme.PinNameColor,
|
|
818
818
|
angle: (0, NumericValue_js_1.numeric)(-90),
|
|
819
819
|
});
|
|
@@ -900,7 +900,7 @@ class SymbolCustomModule extends SymbolCustom {
|
|
|
900
900
|
drawing.addLabel(leftPinStart.add(this.portWidth).add((0, helpers_js_1.milsToMM)(20)), pinY, pin.text, {
|
|
901
901
|
fontSize: (0, NumericValue_js_1.numeric)(40),
|
|
902
902
|
anchor: geometry_js_1.HorizontalAlign.Left,
|
|
903
|
-
vanchor: geometry_js_1.VerticalAlign.
|
|
903
|
+
vanchor: geometry_js_1.VerticalAlign.Center,
|
|
904
904
|
textColor: globals_js_1.ColorScheme.PinNameColor,
|
|
905
905
|
});
|
|
906
906
|
});
|
|
@@ -912,7 +912,7 @@ class SymbolCustomModule extends SymbolCustom {
|
|
|
912
912
|
drawing.addLabel(rightPinStart.sub(this.portWidth).sub((0, helpers_js_1.milsToMM)(20)), pinY, pin.text, {
|
|
913
913
|
fontSize: (0, NumericValue_js_1.numeric)(40),
|
|
914
914
|
anchor: geometry_js_1.HorizontalAlign.Right,
|
|
915
|
-
vanchor: geometry_js_1.VerticalAlign.
|
|
915
|
+
vanchor: geometry_js_1.VerticalAlign.Center,
|
|
916
916
|
textColor: globals_js_1.ColorScheme.PinNameColor,
|
|
917
917
|
});
|
|
918
918
|
});
|
|
@@ -924,7 +924,7 @@ class SymbolCustomModule extends SymbolCustom {
|
|
|
924
924
|
drawing.addLabel(pinX, topPinStart.add(this.portWidth).add((0, helpers_js_1.milsToMM)(20)), pin.text, {
|
|
925
925
|
fontSize: (0, NumericValue_js_1.numeric)(40),
|
|
926
926
|
anchor: geometry_js_1.HorizontalAlign.Right,
|
|
927
|
-
vanchor: geometry_js_1.VerticalAlign.
|
|
927
|
+
vanchor: geometry_js_1.VerticalAlign.Center,
|
|
928
928
|
textColor: globals_js_1.ColorScheme.PinNameColor,
|
|
929
929
|
angle: (0, NumericValue_js_1.numeric)(-90),
|
|
930
930
|
});
|
|
@@ -937,7 +937,7 @@ class SymbolCustomModule extends SymbolCustom {
|
|
|
937
937
|
drawing.addLabel(pinX, bottomPinStart.sub(this.portWidth).sub((0, helpers_js_1.milsToMM)(20)), pin.text, {
|
|
938
938
|
fontSize: (0, NumericValue_js_1.numeric)(40),
|
|
939
939
|
anchor: geometry_js_1.HorizontalAlign.Left,
|
|
940
|
-
vanchor: geometry_js_1.VerticalAlign.
|
|
940
|
+
vanchor: geometry_js_1.VerticalAlign.Center,
|
|
941
941
|
textColor: globals_js_1.ColorScheme.PinNameColor,
|
|
942
942
|
angle: (0, NumericValue_js_1.numeric)(-90),
|
|
943
943
|
});
|
|
@@ -465,7 +465,7 @@ function labelPolygonForAnchors(x, y, width, height, hAnchor, vAnchor) {
|
|
|
465
465
|
[1, 1],
|
|
466
466
|
];
|
|
467
467
|
}
|
|
468
|
-
else if (vAnchor === VerticalAlign.
|
|
468
|
+
else if (vAnchor === VerticalAlign.Center) {
|
|
469
469
|
coordVectors = [
|
|
470
470
|
[0, -0.5],
|
|
471
471
|
[0, 0.5],
|
|
@@ -491,7 +491,7 @@ function labelPolygonForAnchors(x, y, width, height, hAnchor, vAnchor) {
|
|
|
491
491
|
[0, -1],
|
|
492
492
|
];
|
|
493
493
|
}
|
|
494
|
-
else if (vAnchor === VerticalAlign.
|
|
494
|
+
else if (vAnchor === VerticalAlign.Center) {
|
|
495
495
|
coordVectors = [
|
|
496
496
|
[0, -0.5],
|
|
497
497
|
[0, 0.5],
|
|
@@ -508,7 +508,7 @@ function labelPolygonForAnchors(x, y, width, height, hAnchor, vAnchor) {
|
|
|
508
508
|
];
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
|
-
else if (hAnchor === HorizontalAlign.
|
|
511
|
+
else if (hAnchor === HorizontalAlign.Center) {
|
|
512
512
|
if (vAnchor === VerticalAlign.Bottom) {
|
|
513
513
|
coordVectors = [
|
|
514
514
|
[-0.5, 0],
|
|
@@ -517,7 +517,7 @@ function labelPolygonForAnchors(x, y, width, height, hAnchor, vAnchor) {
|
|
|
517
517
|
[0.5, 0]
|
|
518
518
|
];
|
|
519
519
|
}
|
|
520
|
-
else if (vAnchor === VerticalAlign.
|
|
520
|
+
else if (vAnchor === VerticalAlign.Center) {
|
|
521
521
|
coordVectors = [
|
|
522
522
|
[-0.5, 0.5],
|
|
523
523
|
[-0.5, -0.5],
|
|
@@ -544,13 +544,13 @@ function labelPolygonForAnchors(x, y, width, height, hAnchor, vAnchor) {
|
|
|
544
544
|
var HorizontalAlign;
|
|
545
545
|
(function (HorizontalAlign) {
|
|
546
546
|
HorizontalAlign["Left"] = "left";
|
|
547
|
-
HorizontalAlign["
|
|
547
|
+
HorizontalAlign["Center"] = "center";
|
|
548
548
|
HorizontalAlign["Right"] = "right";
|
|
549
549
|
})(HorizontalAlign || (exports.HorizontalAlign = HorizontalAlign = {}));
|
|
550
550
|
var VerticalAlign;
|
|
551
551
|
(function (VerticalAlign) {
|
|
552
552
|
VerticalAlign["Top"] = "top";
|
|
553
|
-
VerticalAlign["
|
|
553
|
+
VerticalAlign["Center"] = "center";
|
|
554
554
|
VerticalAlign["Bottom"] = "bottom";
|
|
555
555
|
})(VerticalAlign || (exports.VerticalAlign = VerticalAlign = {}));
|
|
556
556
|
var HorizontalAlignProp;
|