Skip to content

Commit

Permalink
Make sure font state is correctly remembered, fixes #279
Browse files Browse the repository at this point in the history
  • Loading branch information
jassmith committed Apr 21, 2022
1 parent 0df94f8 commit 3a323a0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
Expand Up @@ -1508,6 +1508,18 @@ export const ThemePerColumn: React.VFC = () => {
accentColor: "#009CA6",
accentLight: "#009CA620",
fgIconHeader: "#FFFFFF",
baseFontStyle: "600 13px",
},
};
c[4] = {
...c[4],
themeOverride: {
textDark: "#009CA6",
bgIconHeader: "#009CA6",
accentColor: "#009CA6",
accentLight: "#009CA620",
fgIconHeader: "#FFFFFF",
baseFontStyle: "600 13px",
},
};
c[9] = {
Expand Down
12 changes: 6 additions & 6 deletions packages/core/src/data-grid/data-grid-render.tsx
Expand Up @@ -1056,20 +1056,20 @@ function drawCells(
ctx.rect(colDrawX, colDrawY, colWidth, colHeight);
ctx.clip();
};
reclip();


const colSelected = selectedColumns.hasIndex(c.sourceIndex);

const groupTheme = getGroupDetails(c.group ?? "").overrideTheme;
const colTheme =
c.themeOverride === undefined && groupTheme === undefined
? outerTheme
: { ...outerTheme, ...groupTheme, ...c.themeOverride };
c.themeOverride === undefined && groupTheme === undefined
? outerTheme
: { ...outerTheme, ...groupTheme, ...c.themeOverride };
const colFont = `${colTheme.baseFontStyle} ${colTheme.fontFamily}`;
if (colFont !== font) {
font = colFont;
ctx.font = colFont;
}
reclip();
let prepResult: PrepResult | undefined = undefined;

walkRowsInCol(
Expand Down

0 comments on commit 3a323a0

Please sign in to comment.