Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
protected layoutTickLabel(tickLabel: RenderView, bounds: BoxR2, anchor: PointR2): void {
const x0 = Math.round(anchor.x);
const y = Math.round(anchor.y);
const x1 = x0 - this.tickMarkLength.value!;
const x2 = x1 - this.tickLabelPadding.value!;
const tickLabelAnchor = new PointR2(x2, y);
tickLabel.setAnchor(tickLabelAnchor);
if (TypesetView.is(tickLabel)) {
tickLabel.textAlign("right");
tickLabel.textBaseline("middle");
}
}
protected layoutTickLabel(tickLabel: RenderView, bounds: BoxR2, anchor: PointR2): void {
const x = Math.round(anchor.x);
const y0 = Math.round(anchor.y);
const y1 = y0 + this.tickMarkLength.value!;
const y2 = y1 + this.tickLabelPadding.value!;
const tickLabelAnchor = new PointR2(x, y2);
tickLabel.setAnchor(tickLabelAnchor);
if (TypesetView.is(tickLabel)) {
tickLabel.textAlign("center");
tickLabel.textBaseline("top");
}
}
protected layoutTickLabel(tickLabel: RenderView, bounds: BoxR2, anchor: PointR2): void {
const x = Math.round(anchor.x);
const y0 = Math.round(anchor.y);
const y1 = y0 - this.tickMarkLength.value!;
const y2 = y1 - this.tickLabelPadding.value!;
const tickLabelAnchor = new PointR2(x, y2);
tickLabel.setAnchor(tickLabelAnchor);
if (TypesetView.is(tickLabel)) {
tickLabel.textAlign("center");
tickLabel.textBaseline("bottom");
}
}
protected layoutTickLabel(tickLabel: RenderView, bounds: BoxR2, anchor: PointR2): void {
const x0 = Math.round(anchor.x);
const y = Math.round(anchor.y);
const x1 = x0 + this.tickMarkLength.value!;
const x2 = x1 + this.tickLabelPadding.value!;
const tickLabelAnchor = new PointR2(x2, y);
tickLabel.setAnchor(tickLabelAnchor);
if (TypesetView.is(tickLabel)) {
tickLabel.textAlign("left");
tickLabel.textBaseline("middle");
}
}