Skip to content

Commit

Permalink
refactor: flash comment
Browse files Browse the repository at this point in the history
  • Loading branch information
xpadev-net committed Nov 19, 2023
1 parent 8214920 commit 26da5f0
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/comments/FlashComment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,16 @@ class FlashComment extends BaseComment {
const atButtonRadius = getConfig(config.atButtonRadius, true);
const isHover = this.isHovered(cursor, posX, posY);
context.save();
context.strokeStyle =
this.comment.button.limit < 1
? "#777777"
: isHover
? this.comment.color
: "white";
const getStrokeStyle = () => {
if (isHover) {
return this.comment.color;
}
if (this.comment.button && this.comment.button.limit < 1) {
return "#777777";
}
return "white";
};
context.strokeStyle = getStrokeStyle();
drawLeftBorder(
context,
parts.left.left,
Expand Down

0 comments on commit 26da5f0

Please sign in to comment.