mirror of
https://github.com/google/blockly.git
synced 2026-01-11 02:47:09 +01:00
fix: comment highlight being positioned incorrectly in RTL (#8044)
This commit is contained in:
@@ -311,9 +311,8 @@ export class CommentView implements IRenderedElement {
|
||||
|
||||
this.svgRoot.setAttribute('height', `${size.height}`);
|
||||
this.svgRoot.setAttribute('width', `${size.width}`);
|
||||
this.highlightRect.setAttribute('height', `${size.height}`);
|
||||
this.highlightRect.setAttribute('width', `${size.width}`);
|
||||
|
||||
this.updateHighlightRect(size);
|
||||
this.updateTopBarSize(size);
|
||||
this.updateTextAreaSize(size, topBarSize);
|
||||
this.updateDeleteIconPosition(size, topBarSize, deleteSize);
|
||||
@@ -377,6 +376,15 @@ export class CommentView implements IRenderedElement {
|
||||
return (topBarSize.height - foldoutSize.height) / 2;
|
||||
}
|
||||
|
||||
/** Updates the size of the highlight rect to reflect the new size. */
|
||||
private updateHighlightRect(size: Size) {
|
||||
this.highlightRect.setAttribute('height', `${size.height}`);
|
||||
this.highlightRect.setAttribute('width', `${size.width}`);
|
||||
if (this.workspace.RTL) {
|
||||
this.highlightRect.setAttribute('x', `${-size.width}`);
|
||||
}
|
||||
}
|
||||
|
||||
/** Updates the size of the top bar to reflect the new size. */
|
||||
private updateTopBarSize(size: Size) {
|
||||
this.topBarBackground.setAttribute('width', `${size.width}`);
|
||||
|
||||
Reference in New Issue
Block a user