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

Preview - Add label index overlay text to preview screen #38

Merged
merged 1 commit into from
Nov 17, 2018

Conversation

chmorgan
Copy link
Contributor

First draft of adding label index overlay text to the preview screen. The snprintf() seemed like it could be out of place but I didn't see any other value to string conversion going on. Also it didn't seem great to assume the order of the origins corresponding to the index of the label, unless of course that is a safe assumption.

I also didn't see any rotation support in the preview screen so maybe the rotation flag and code can/should be removed if it isn't necessary.

model::Distance minWH = min( w, h );

char labelText[32];
snprintf(labelText, sizeof(labelText), "%d", labelInstance);
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't this be better implemented using QString? E.g.:

auto labelText = QString::number(labelInstance);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sur5r yep, thats much simpler, corrected that and removed the rotation support and re-pushed for re-review

Copy link
Owner

Choose a reason for hiding this comment

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

Looks good!

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.

3 participants