Skip to content

Commit f2af498

Browse files
Fix issues based on Copilot feedback
1 parent 4828c8e commit f2af498

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/SixLabors.Fonts/ObjectPool{T}.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public ObjectPool(IPooledObjectPolicy<T> policy, int maximumRetained)
4343
// cache the target interface methods, to avoid interface lookup overhead
4444
this.createFunc = policy.Create;
4545
this.returnFunc = policy.Return;
46-
this.maxCapacity = maximumRetained - 1; // -1 to account for _fastItem
46+
this.maxCapacity = maximumRetained - 1; // -1 to account for fastItem
4747
}
4848

4949
/// <summary>

src/SixLabors.Fonts/StreamFontMetrics.TrueType.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ internal void ApplyTrueTypeHinting(HintingMode hintingMode, GlyphMetrics metrics
6666
{
6767
CvtTable? cvt = tables.Cvt;
6868
PrepTable? prep = tables.Prep;
69-
float scaleFactor = pixelSize / this.UnitsPerEm;
70-
interpreter.SetControlValueTable(cvt?.ControlValues, scaleFactor, pixelSize, prep?.Instructions);
69+
float hintingScaleFactor = pixelSize / this.UnitsPerEm;
70+
interpreter.SetControlValueTable(cvt?.ControlValues, hintingScaleFactor, pixelSize, prep?.Instructions);
7171

7272
Bounds bounds = glyphVector.Bounds;
7373

src/SixLabors.Fonts/StreamFontMetrics.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ internal StreamFontMetrics(TrueTypeFontTables tables)
6767
(HorizontalMetrics HorizontalMetrics, VerticalMetrics VerticalMetrics) metrics = this.Initialize(tables);
6868
this.horizontalMetrics = metrics.HorizontalMetrics;
6969
this.verticalMetrics = metrics.VerticalMetrics;
70+
71+
this.interpreterPool = new ObjectPool<TrueTypeInterpreter>(new TrueTypeInterpreterPooledObjectPolicy(this));
7072
}
7173

7274
/// <summary>
@@ -85,8 +87,6 @@ internal StreamFontMetrics(CompactFontTables tables)
8587
(HorizontalMetrics HorizontalMetrics, VerticalMetrics VerticalMetrics) metrics = this.Initialize(tables);
8688
this.horizontalMetrics = metrics.HorizontalMetrics;
8789
this.verticalMetrics = metrics.VerticalMetrics;
88-
89-
this.interpreterPool = new ObjectPool<TrueTypeInterpreter>(new TrueTypeInterpreterPooledObjectPolicy(this));
9090
}
9191

9292
public HeadTable.HeadFlags HeadFlags { get; private set; }

0 commit comments

Comments
 (0)