Skip to content

Commit

Permalink
#3545 follow the latest design
Browse files Browse the repository at this point in the history
  • Loading branch information
StarlaStarla committed Jan 9, 2024
1 parent 2ea12ae commit 46adfed
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
2 changes: 2 additions & 0 deletions packages/ketcher-core/src/application/editor/tools/Bond.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ class PolymerBond implements BaseTool {
this.editor.drawingEntitiesManager.hidePolymerBondInformation(
renderer.polymerBond,
);
this.editor.renderersContainer.markForRecalculateBegin();
this.editor.renderersContainer.update(modelChanges);
}

Expand All @@ -112,6 +113,7 @@ class PolymerBond implements BaseTool {
this.editor.drawingEntitiesManager.showPolymerBondInformation(
renderer.polymerBond,
);
this.editor.renderersContainer.markForRecalculateBegin();
this.editor.renderersContainer.update(modelChanges);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,13 +368,6 @@ export abstract class BaseMonomerRenderer extends BaseRenderer {
y: number;
} | void;

protected get beginningElementColor() {
if (this.monomer.hovered) {
return '#0097A8';
}
return '#7C7C7F';
}

public setEnumeration(enumeration: number | null) {
this.enumeration = enumeration;
}
Expand Down Expand Up @@ -410,11 +403,11 @@ export abstract class BaseMonomerRenderer extends BaseRenderer {
this.beginningElement = this.rootElement
.append('text')
.attr('direction', 'rtl')
.attr('fill', '#0097A8')
.attr('font-size', '12px')
.attr('line-height', '14px')
.attr('font-weight', '500')
.attr('text-align', 'right')
.attr('fill', this.beginningElementColor)
.attr('x', this.beginningElementPosition.x)
.attr('y', this.beginningElementPosition.y)
.text(this.beginning);
Expand All @@ -424,7 +417,6 @@ export abstract class BaseMonomerRenderer extends BaseRenderer {
assert(this.beginningElement);
assert(this.beginningElementPosition);
this.beginningElement
.attr('fill', this.beginningElementColor)
.attr('x', this.beginningElementPosition.x)
.attr('y', this.beginningElementPosition.y)
.text(this.beginning);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export class PeptideRenderer extends BaseMonomerRenderer {

protected get beginningElementPosition() {
if (this.monomer.hovered) {
return { x: 0, y: -29 };
return { x: 2, y: -30 };
}
return { x: 0, y: -2 };
return { x: 2, y: -1 };
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export class SugarRenderer extends BaseMonomerRenderer {

protected get beginningElementPosition() {
if (this.monomer.hovered) {
return { x: 0, y: -29 };
return { x: -6, y: -30 };
}
return { x: -4, y: -2 };
return { x: -2, y: -1 };
}
}

0 comments on commit 46adfed

Please sign in to comment.