Skip to content

Commit

Permalink
Adjust comment styling for extended cells to ensure consistent appear…
Browse files Browse the repository at this point in the history
…ance

Signed-off-by: Banobe Pascal <banobe.pascal@collabora.com>
Change-Id: I62f8298368eb2129a031ddd1fb56a918e8266df7
  • Loading branch information
Banobe Pascal committed Dec 25, 2024
1 parent cb100b9 commit 788afea
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions browser/src/canvas/sections/CommentSection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1337,16 +1337,17 @@ export class Comment extends CanvasSectionObject {
if (cellSize[0] !== 0 && cellSize[1] !== 0) { // don't draw notes in hidden cells
// For calc comments (aka postits) draw the same sort of square as ScOutputData::DrawNoteMarks
// does for offline
var margin = cellSize[0] * 0.06;
var squareDim = 6;
var margin = 1;
var squareDim = 12;
const isRTL = this.isCalcRTL();
// this.size may currently have an artifically wide size if mouseEnter without moveLeave seen
// so fetch the real size
var x = this.isCalcRTL() ? margin : cellSize[0] - (margin + squareDim);
var x = isRTL ? margin : cellSize[0] - squareDim - margin;
this.context.fillStyle = '#BF819E';
var region = new Path2D();
region.moveTo(x, 0);
region.lineTo(cellSize[0], 0);
region.lineTo(cellSize[0], cellSize[1]/2);
region.lineTo(x + squareDim, 0);
region.lineTo(x + (isRTL ? 0 : squareDim), squareDim);
region.closePath();
this.context.fill(region);
}
Expand Down

0 comments on commit 788afea

Please sign in to comment.