reimplement raylines

This commit is contained in:
louisnw
2024-05-31 18:29:52 +01:00
parent 7915863a64
commit a8a11efcf6
6 changed files with 41 additions and 12 deletions

View File

@ -17,7 +17,7 @@ export class HorizontalLinePaneView extends DrawingPaneView {
const timeScale = this._source.chart.timeScale()
const series = this._source.series;
if (this._source._type == "RayLine") {
this._point.x = timeScale.logicalToCoordinate(point.logical);
this._point.x = point.time ? timeScale.timeToCoordinate(point.time) : timeScale.logicalToCoordinate(point.logical);
}
this._point.y = series.priceToCoordinate(point.price);
}

View File

@ -10,7 +10,7 @@ export class RayLine extends HorizontalLine {
_type = 'RayLine';
constructor(point: Point, options: DeepPartial<DrawingOptions>) {
super(point, options);
super({...point}, options);
this._point.time = point.time;
}