Skip to content

Commit

Permalink
Fix scrollbar color in darkmode for writer and draw
Browse files Browse the repository at this point in the history
Signed-off-by: Banobe Pascal <[email protected]>
Change-Id: Ied41faf1bd078a72b23e6f1bc6ae26a2268b1b98
  • Loading branch information
Banobe Pascal authored and eszkadev committed Jan 3, 2025
1 parent c65330d commit 0403a6e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions browser/src/canvas/sections/ScrollSection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,15 @@ export class ScrollSection extends CanvasSectionObject {

private drawVerticalScrollBar (): void {
var scrollProps: any = this.getVerticalScrollProperties();
const isDarkBackground = this.map.uiManager.isBackgroundDark();
const docType = this.sectionProperties.docLayer._docType;

var startX = this.isRTL() ? this.sectionProperties.edgeOffset : this.size[0] - this.sectionProperties.scrollBarThickness - this.sectionProperties.edgeOffset;

if (isDarkBackground && (docType === 'text' || docType === 'drawing')) {
this.sectionProperties.scrollBarRailwayColor = 'transparent';
}

if (this.sectionProperties.drawScrollBarRailway) {
this.context.globalAlpha = this.sectionProperties.scrollBarRailwayAlpha;
this.context.fillStyle = this.sectionProperties.scrollBarRailwayColor;
Expand Down

0 comments on commit 0403a6e

Please sign in to comment.