Skip to content

Commit

Permalink
This time really commit the code
Browse files Browse the repository at this point in the history
  • Loading branch information
jassmith committed May 26, 2022
1 parent 34aca8e commit a79b5b8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/core/src/data-grid/data-grid-lib.ts
Expand Up @@ -285,8 +285,9 @@ function loadMetric(ctx: CanvasRenderingContext2D, baseline: "alphabetic" | "mid
const biasCache: { key: string; val: number }[] = [];

function getMiddleCenterBiasInner(ctx: CanvasRenderingContext2D, font: string): number {
const r = biasCache.find(x => x.key === font);
if (r !== undefined) return r.val;
for (const x of biasCache) {
if (x.key === font) return x.val;
}

const alphabeticMetrics = loadMetric(ctx, "alphabetic");
const middleMetrics = loadMetric(ctx, "middle");
Expand Down

0 comments on commit a79b5b8

Please sign in to comment.