This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
Introduce Size type - #6674
Merged
Merged
Introduce Size type#6674
Conversation
Contributor
|
👍. This type should basically be |
|
@kkaefer, thanks for your PR! By analyzing the history of the files in this pull request, we identified @brunoabinader, @jfirebaugh and @ansis to be potential reviewers. |
jfirebaugh
approved these changes
Oct 26, 2016
| uint16_t getWidth() const; | ||
| uint16_t getHeight() const; | ||
| void setSize(Size); | ||
| uint32_t getWidth() const; |
Contributor
There was a problem hiding this comment.
We should combine getWidth() and getHeight() into a single getSize().
|
|
||
| float getWidth() const { return image.width / pixelRatio; } | ||
| float getHeight() const { return image.height / pixelRatio; } | ||
| float getWidth() const { return image.size.width / pixelRatio; } |
Member
Author
There was a problem hiding this comment.
In this particular case, we're using floats to represent the width/height, but our Size type uses integers, so we should keep this.
| } | ||
|
|
||
| context.viewport = { 0, 0, size[0], size[1] }; | ||
| context.viewport = { 0, 0, size.width, size.height }; |
Contributor
There was a problem hiding this comment.
Should be able to do context.viewport = { 0, 0, size }.
kkaefer
force-pushed
the
6674-size-type
branch
3 times, most recently
from
October 27, 2016 22:37
c51321a to
da1d52c
Compare
kkaefer
force-pushed
the
6674-size-type
branch
2 times, most recently
from
October 28, 2016 01:19
c2b362d to
e71f66b
Compare
kkaefer
force-pushed
the
6674-size-type
branch
from
October 28, 2016 01:31
e71f66b to
62b56b7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We frequently specify sizes that have a width and a height and should introduce a size type that encodes this instead of using
std::array<uint16_t, 2>in those places./cc @jfirebaugh