Skip to content

Center label relative to barcode#198

Open
mjamro wants to merge 2 commits intobarnhill:masterfrom
mjamro:feature/center-label
Open

Center label relative to barcode#198
mjamro wants to merge 2 commits intobarnhill:masterfrom
mjamro:feature/center-label

Conversation

@mjamro
Copy link
Copy Markdown

@mjamro mjamro commented Mar 16, 2024

Bug: The label text is rendered relative to the middle of the image instead of the middle of the actual barcode.

This PR requires #196

Current behaviour

Label text not in the middle of the barcode.
Zrzut ekranu 2024-03-16 115046

After changes

Label text in the middle of the barcode.

image

@mjamro mjamro force-pushed the feature/center-label branch from cde1ea2 to 00bff1e Compare March 16, 2024 11:56
@mjamro mjamro force-pushed the feature/center-label branch 3 times, most recently from 466f9cd to 244b421 Compare March 18, 2024 12:15

g.DrawRect(new SKRect(s1, img.Height - textBounds1.Height - textBounds1.Height / 4f, s1 + w1, img.Height), backBrush); // first guard bar cover

if (barcode.GuardBarsMode == GuardBarsMode.Enabled)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did this leak in from the other change for guard bars?

foreBrush.FilterQuality = SKFilterQuality.High;

g.DrawText(first, s1 + (w1 / 2f - textBounds1.Width / 2f), img.Height, foreBrush);
if (barcode.GuardBarsMode == GuardBarsMode.Enabled)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants