Skip to content

Commit

Permalink
Pull request #5406: [DXCF-5744] [Native mobile] Long tap on some cand…
Browse files Browse the repository at this point in the history
…le - crosshair jumps to the wrong place

Merge in DXCHARTS/dxchart5 from bugfix/DXCF-5744-native-mobile-long-tap-on-some-candle-crosshair-jumps-to-the-wrong-place to master

* commit '6dd7ff594daa266ca6e54df035c1af3082acf02e':
  [DXCF-5744] [Native mobile] Long tap on some candle - crosshair jumps to the wrong place // removed unnecessary fix, and console.log
  [DXCF-5744] [Native mobile] Long tap on some candle - crosshair jumps to the wrong place

GitOrigin-RevId: cf831c0ea81f9f9a05408b5a563f4ada402210da
  • Loading branch information
artskar authored and dxcity committed Jan 13, 2025
1 parent 074763d commit 24738ae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/chart/components/cross_tool/cross-tool.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export class CrossToolModel extends ChartBaseElement {
/**
* Updates the current hover position with the provided hover object.
* @param {Object} hover - The hover object containing the x and y coordinates and time formatted.
* @param magnetTarget {MagnetTarget}
* @param {number} hover.x - The x coordinate of the hover.
* @param {number} hover.y - The y coordinate of the hover.
* @param {string} hover.timeFormatted - The formatted time of the hover.
Expand Down
7 changes: 6 additions & 1 deletion src/chart/inputhandlers/hover-producer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,11 @@ export class HoverProducerComponent extends ChartBaseElement {

if (!this.crossEventProducer.crossToolTouchInfo.isSet) {
this.crossEventProducer.crossToolTouchInfo.isSet = true;
// previous fixed goes to temporary to prevent crosstool jumps outside the candle on candle update tick
this.crossEventProducer.crossToolTouchInfo.temp = {
x: this.crossEventProducer.crossToolTouchInfo.fixed.x,
y: this.crossEventProducer.crossToolTouchInfo.fixed.y,
};
this.crossEventProducer.crossToolTouchInfo.fixed = {
x,
y,
Expand Down Expand Up @@ -260,6 +265,7 @@ export class HoverProducerComponent extends ChartBaseElement {
* Creates a hover object based on the provided x and y coordinates.
* @param {number} x - The x coordinate of the hover.
* @param {number} y - The y coordinate of the hover.
* @param {string} uuid
* @returns {Hover | undefined} - The hover object or undefined if there are no candles in the chart model.
* @todo Check if uuid is still useful here.
*/
Expand Down Expand Up @@ -334,7 +340,6 @@ export class HoverProducerComponent extends ChartBaseElement {
* If no hover event is provided, it fires the EVENT_CLOSE_HOVER event.
*
* @param {Hover} [hover] - The hover event to handle.
* @param {boolean} [showCrossTool=true] - A boolean value indicating whether to show the cross tool or not.
* @returns {void}
*/
private fireHover(hover?: Hover) {
Expand Down

0 comments on commit 24738ae

Please sign in to comment.