Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug where background was incorrectly reset given multiple strings #105

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

emielsteerneman
Copy link

There is a bug in cudaFonts.cu:479 that causes incorrect backgrounds to be drawn when multiple strings are given to cudaFont::OverlayText. The current rectangle from mRectsCPU is not correctly indexed. Instead, always the first rectangle in mRectsCPU is indexed and reset. Incrementing with numRects fixes this issue.

Code to make the issue more clear:

std::vector< std::pair< std::string, int2 > > labels;
labels.push_back(std::pair<std::string, int2>("Box One", {1100, 700}));
labels.push_back(std::pair<std::string, int2>("Box Two", {1150, 900}));
labels.push_back(std::pair<std::string, int2>("Box Three", {1450, 800}));
font->OverlayText(output, format, width, height, labels, make_float4(255,255,255,255), make_float4(0, 0, 0, 255), 20);

Two images showing the result before and after the fix:

before

chess_before_fix

after

chess_after_fix

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.

1 participant