From 5795634b46842de267c6398a9ce3d8e4692de11c Mon Sep 17 00:00:00 2001 From: Anton Vorobev Date: Fri, 10 Jan 2025 12:26:45 +0000 Subject: [PATCH] Pull request #5431: Bugfix/DXCF-5766 events conference calls hover over events rhombus notice that hover zone is shifted Merge in DXCHARTS/dxchart5 from bugfix/DXCF-5766-events-conference-calls-hover-over-events-rhombus-notice-that-hover-zone-is-shifted to master * commit '09e6b54d86b4f204a95515589620246b862e3b6c': [DXCF-5766] Events - Conference Calls - Hover over events rhombus, notice that hover zone is shifted to the right // copy [DXCF-5766] Events - Conference Calls - Hover over events rhombus, notice that hover zone is shifted to the right // init GitOrigin-RevId: 31a899a35a607927f3fd281a2c8ee50845f1dc56 --- src/chart/components/events/events-hit-test.drawer.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/chart/components/events/events-hit-test.drawer.ts b/src/chart/components/events/events-hit-test.drawer.ts index 27e7661..63ca5f9 100644 --- a/src/chart/components/events/events-hit-test.drawer.ts +++ b/src/chart/components/events/events-hit-test.drawer.ts @@ -38,6 +38,11 @@ export class EventsHitTestDrawer implements Drawer { const bounds = this.canvasBoundsContainer.getBounds(CanvasElement.EVENTS); ctx.save(); this.model.events.forEach((event, idx) => { + const visible = this.config.components.events.eventsVisibility[event.type]; + if (!visible) { + return; + } + const prevEvent = this.model.events[idx - 1]; const prevX = prevEvent && @@ -53,7 +58,8 @@ export class EventsHitTestDrawer implements Drawer { const hoverSize = (size + hoverExtendedAreaPixels) * 2; if (prevX !== undefined) { const prevSize = getEventSize(prevEvent); - const isIntersectsWithPrev = prevX + prevSize > x - hoverSize / 2; + const prevVisible = this.config.components.events.eventsVisibility[prevEvent.type]; + const isIntersectsWithPrev = prevVisible && prevX + prevSize > x - hoverSize / 2; if (isIntersectsWithPrev) { const hoverSize = size * 2 + hoverExtendedAreaPixels; ctx.fillRect(prevX + prevSize, bounds.y, hoverSize, bounds.height);