Remove VML legacy code.

This commit is contained in:
Paulo Gustavo Veiga 2022-02-18 15:52:57 -08:00
parent 987a271e93
commit 650d70e05f
2 changed files with 1 additions and 18 deletions

View File

@ -154,7 +154,7 @@ class ConnectionLine {
} }
} }
setStroke(color: string, style, opacity: number) { setStroke(color: string, style: string, opacity: number) {
this._line2d.setStroke(null, null, color, opacity); this._line2d.setStroke(null, null, color, opacity);
} }

View File

@ -174,23 +174,6 @@ class ElementPeer {
this._native.setAttribute('stroke', color); this._native.setAttribute('stroke', color);
} }
if ($defined(style)) { if ($defined(style)) {
// Scale the dash array in order to be equal to VML. In VML, stroke style doesn't scale.
const dashArrayPoints = ElementPeer.stokeStyleToStrokDasharray()[style];
const scale = 1 / TransformUtil.workoutScale(this).width;
let strokeWidth = this._native.getAttribute('stroke-width');
strokeWidth = parseFloat(strokeWidth);
const scaledPoints = [];
for (let i = 0; i < dashArrayPoints.length; i++) {
// VML scale the stroke based on the stroke width.
scaledPoints[i] = dashArrayPoints[i] * strokeWidth;
// Scale the points based on the scale.
scaledPoints[i] = `${scaledPoints[i] * scale}px`;
}
// this._native.setAttribute('stroke-dasharray', scaledPoints);
this._stokeStyle = style; this._stokeStyle = style;
} }