From 21aa3a76f223a18f08feb69fa73fbcaaa74cfb4e Mon Sep 17 00:00:00 2001 From: MWicenec Date: Wed, 17 Jan 2024 15:07:52 +0800 Subject: [PATCH] figured out tutorial highlight draw bug --- src/Tutorial.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Tutorial.ts b/src/Tutorial.ts index 34ff26cdc..6f51be281 100644 --- a/src/Tutorial.ts +++ b/src/Tutorial.ts @@ -337,18 +337,27 @@ export class Tutorial { } highlightStepTarget = (target: JQuery): void => { + const eagle = Eagle.getInstance() if(TutorialSystem.activeTutCurrentStep.getAlternateHightlightTargetFunc() != null){ target = TutorialSystem.activeTutCurrentStep.getAlternateHightlightTargetFunc()() } + console.log(target) + //in order to darken the screen save the selection target, we must add divs on each side of the element. const coords = target.offset() const docWidth = window.innerWidth const top_actual = Math.round(coords.top)//distance of the top of the element from the top of the document - const right = coords.left + $(target).outerWidth() + let right = coords.left + $(target).outerWidth() const left = docWidth - coords.left - const targetHeight = Math.round($(target).outerHeight()) - const bottom_actual = Math.round(coords.top + targetHeight) //distance from the bottom of the target element to the bottom of the document + let targetHeight = Math.round($(target).outerHeight()) + let bottom_actual = Math.round(coords.top + targetHeight) //distance from the bottom of the target element to the bottom of the document + + if(target.parents('#logicalGraphParent').length){ + targetHeight = Math.round(targetHeight*eagle.globalScale()) + right = coords.left+$(target).outerWidth() *eagle.globalScale() + bottom_actual = Math.round(coords.top + targetHeight) + } //i am appending these once if they dont exist. they are then adjusted for each step. and finally removed when exiting the tutorial if ($('.tutorialHighlight').length === 0) {