From 06dd9f8124da6d06de247de4fb1dc4004e14d669 Mon Sep 17 00:00:00 2001 From: Roman Rodionov Date: Thu, 18 Apr 2024 16:28:47 +0200 Subject: [PATCH] #3899 - Macro: Attachment points do not disappear when hover is removed from some monomers. (#4482) - added AttachmentPoint instance binding to it's html elements - added pointer-events: none by default for all elements of attachment point and explicitly pointer-events: auto to it's hover area - fixed(reduced) size of attachment point hover area - fixed case with switching tool by hotkeys --------- Co-authored-by: Roman Rodionov --- ...-mouse-wheel-and-CTRL-3-chromium-linux.png | Bin 14265 -> 14369 bytes .../src/application/editor/tools/Bond.ts | 61 ++++++++-- .../src/domain/AttachmentPoint.ts | 114 +++++++++--------- .../domain/entities/DrawingEntitiesManager.ts | 21 +++- 4 files changed, 122 insertions(+), 74 deletions(-) diff --git a/ketcher-autotests/tests/Macromolecule-editor/Zoom-Tool/zoom-tool.spec.ts-snapshots/Zoom-Tool-Zoom-In-Out-attachment-points-with-mouse-wheel-and-CTRL-3-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Zoom-Tool/zoom-tool.spec.ts-snapshots/Zoom-Tool-Zoom-In-Out-attachment-points-with-mouse-wheel-and-CTRL-3-chromium-linux.png index 029132021116b520e1f1a2ecc46af8d2c82217c8..dd9ff60ee982e0244d894fb5b23dcd6b3c63d616 100644 GIT binary patch literal 14369 zcmeHuXIPZy*6s^Ph`~tQMhPMi6+xv%KoF_MAQ`HFfJoCwQ<{Q+Lsz#YBA`Q)I#>Xy zqx25OATX3cibx%#%s6xyhG7`WSr5tH-}mja&v(wb&d-w{Tugc1_g&9=R=L-`*8FPXS>(cVFia@e!2BN@5pZ^ZzSV?Xzl1|lxsF@N^i04Fzh6lF`pQu-`&%o zfp6*R8fcq;arZ%@_qVD#jz@RtMu>eOBJzYPu}7LOhLDg{PU8e=(Dn_nkFi-I;s=%! zXW2FR1$}*ecR>stB`f<09(Zvf_#2QB`}S5HKZd1!vqc`>-1+`0e06BcO+i?=?@L?w z=&O^%ycl-o%h+^r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R(h72i>vQk3*gzQ3WzL); - private attachmentPoint: D3SvgElementSelection | null; - private monomer: BaseMonomer; + private attachmentPoint: D3SvgElementSelection | null; + public monomer: BaseMonomer; private bodyWidth: number; private bodyHeight: number; - private attachmentPointName: string; + private attachmentPointName: AttachmentPointName; private canvasOffset: Coordinates; private centerOfMonomer: Coordinates; - private element: Selection | undefined; + private element: Selection | undefined; private hoverableArea: - | Selection + | Selection | undefined; private initialAngle = 0; private isUsed: boolean; - private fill: string; - private stroke: string; private isSnake; private editorEvents: typeof editorEvents; @@ -69,25 +67,35 @@ export class AttachmentPoint { this.editorEvents = editorEvents; this.attachmentPoint = null; - if (constructorParams.isPotentiallyUsed) { - this.fill = AttachmentPoint.colors.fillPotentially; - this.stroke = AttachmentPoint.colors.strokePotentially; - } else if (constructorParams.isUsed) { - this.fill = AttachmentPoint.colors.fillUsed; - this.stroke = AttachmentPoint.colors.strokeUsed; + this.appendAttachmentPoint(); + } + + private get fill() { + if ( + this.monomer.isAttachmentPointPotentiallyUsed(this.attachmentPointName) + ) { + return AttachmentPoint.colors.fillPotentially; + } else if (this.monomer.isAttachmentPointUsed(this.attachmentPointName)) { + return AttachmentPoint.colors.fillUsed; } else { - this.fill = AttachmentPoint.colors.fill; - this.stroke = AttachmentPoint.colors.stroke; + return AttachmentPoint.colors.fill; } + } - this.appendAttachmentPoint(); + private get stroke() { + if ( + this.monomer.isAttachmentPointPotentiallyUsed(this.attachmentPointName) + ) { + return AttachmentPoint.colors.strokePotentially; + } else if (this.monomer.isAttachmentPointUsed(this.attachmentPointName)) { + return AttachmentPoint.colors.strokeUsed; + } else { + return AttachmentPoint.colors.stroke; + } } public removeAttachmentPoint() { - const remove = () => { - this.element?.remove(); - }; - setTimeout(remove, 1); + this.element?.remove(); } private renderAttachmentPointByCoordinates( @@ -98,7 +106,10 @@ export class AttachmentPoint { const fill = this.fill; const stroke = this.stroke; - this.attachmentPoint = this.rootElement.insert('g', ':first-child'); + this.attachmentPoint = this.rootElement + .insert('g', ':first-child') + .data([this]) + .style('pointer-events', 'none'); const attachmentPointElement = this.attachmentPoint.append('g'); @@ -144,7 +155,7 @@ export class AttachmentPoint { } const rotation = angleDegrees + 90; - const halfWidth = 20; + const halfWidth = 8; const areaHeight = Math.sqrt( (monomerCenter.x - attachmentPointCenter.x) ** 2 + @@ -152,8 +163,8 @@ export class AttachmentPoint { ); const points: Coordinates[] = [ - { x: -AttachmentPoint.radius, y: AttachmentPoint.radius }, - { x: AttachmentPoint.radius, y: AttachmentPoint.radius }, + { x: -AttachmentPoint.radius, y: AttachmentPoint.radius + 2 }, + { x: AttachmentPoint.radius, y: AttachmentPoint.radius + 2 }, { x: halfWidth, y: -areaHeight + 10, @@ -162,7 +173,7 @@ export class AttachmentPoint { x: -halfWidth, y: -areaHeight + 10, }, - { x: -AttachmentPoint.radius, y: AttachmentPoint.radius }, + { x: -AttachmentPoint.radius, y: AttachmentPoint.radius + 2 }, ]; const lineFunction = line() @@ -178,6 +189,7 @@ export class AttachmentPoint { .attr('stroke-width', '1px') .attr('fill', '#0097A8') .style('opacity', '0') + .style('pointer-events', 'auto') .attr( 'transform', `translate(${attachmentPointCenter.x},${attachmentPointCenter.y})rotate(${rotation})`, @@ -206,26 +218,20 @@ export class AttachmentPoint { public appendAttachmentPoint() { let angleDegrees; let angleRadians: number; - const flip = - this.monomer.id === - this.monomer.attachmentPointsToBonds[this.attachmentPointName] - ?.firstMonomer?.id; + const polymerBond = + this.monomer.attachmentPointsToBonds[this.attachmentPointName]; + const flip = this.monomer.id === polymerBond?.firstMonomer?.id; const isAttachmentpointR1 = this.attachmentPointName === 'R1'; - if (!this.isUsed) { + if (!polymerBond) { angleDegrees = this.initialAngle; } else if ( this.isSnake && - !this.monomer.attachmentPointsToBonds[ - this.attachmentPointName - ]?.renderer.isMonomersOnSameHorizontalLine() + !polymerBond?.renderer?.isMonomersOnSameHorizontalLine() ) { angleRadians = isAttachmentpointR1 ? 0 : Math.PI; angleDegrees = Vec2.radiansToDegrees(angleRadians); } else { - angleRadians = this.rotateToAngle( - this.monomer.attachmentPointsToBonds[this.attachmentPointName], - flip, - ); + angleRadians = this.rotateToAngle(polymerBond, flip); angleDegrees = Vec2.radiansToDegrees(angleRadians); } @@ -263,18 +269,11 @@ export class AttachmentPoint { } public updateAttachmentPointStyleForHover() { - const isAttachmentPointUsed = this.monomer.isAttachmentPointUsed( - this.attachmentPointName as AttachmentPointName, - ); - if (isAttachmentPointUsed) { - this.attachmentPoint - ?.select('line') - .style('stroke', AttachmentPoint.colors.fillUsed); - this.attachmentPoint - ?.select('circle') - .style('fill', AttachmentPoint.colors.fillUsed) - .attr('stroke', 'white'); - } + this.attachmentPoint?.select('line').style('stroke', this.stroke); + this.attachmentPoint + ?.select('circle') + .style('fill', this.fill) + .attr('stroke', this.fill === 'white' ? '#0097A8' : 'white'); } public rotateToAngle(polymerBond: PolymerBond, flip = false) { @@ -327,15 +326,14 @@ export class AttachmentPoint { } public updateCoords() { - const flip = - this.monomer.id === - this.monomer.attachmentPointsToBonds[this.attachmentPointName] - ?.firstMonomer?.id; - - const angleRadians = this.rotateToAngle( - this.monomer.attachmentPointsToBonds[this.attachmentPointName], - flip, - ); + const polymerBond = + this.monomer.attachmentPointsToBonds[this.attachmentPointName]; + + assert(polymerBond); + + const flip = this.monomer.id === polymerBond?.firstMonomer?.id; + + const angleRadians = this.rotateToAngle(polymerBond, flip); const angleDegrees = Vec2.radiansToDegrees(angleRadians); const [ diff --git a/packages/ketcher-core/src/domain/entities/DrawingEntitiesManager.ts b/packages/ketcher-core/src/domain/entities/DrawingEntitiesManager.ts index 6f4612e322..bef9fdecf4 100644 --- a/packages/ketcher-core/src/domain/entities/DrawingEntitiesManager.ts +++ b/packages/ketcher-core/src/domain/entities/DrawingEntitiesManager.ts @@ -750,14 +750,11 @@ export class DrawingEntitiesManager { monomer.turnOnHover(); monomer.turnOnAttachmentPointsVisibility(); - if ( - monomer.isAttachmentPointUsed(attachmentPointName as AttachmentPointName) - ) { + if (monomer.isAttachmentPointUsed(attachmentPointName)) { const operation = new MonomerHoverOperation(monomer, true); command.addOperation(operation); return command; } - if (attachmentPointName) { monomer.setPotentialSecondAttachmentPoint(attachmentPointName); monomer.setPotentialBond(attachmentPointName, bond); @@ -1777,6 +1774,22 @@ export class DrawingEntitiesManager { return command; } + + public removeHoverForAllMonomers() { + const command = new Command(); + this.monomers.forEach((monomer) => { + if (!monomer.hovered) { + return; + } + + monomer.turnOffHover(); + monomer.turnOffAttachmentPointsVisibility(); + + command.addOperation(new MonomerHoverOperation(monomer, true)); + }); + + return command; + } } function getFirstPosition(height: number, lastPosition: Vec2) { return new Vec2(MONOMER_START_X_POSITION, lastPosition.y + height);