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

Move width and height to the base renderer class definition. #962

Merged
merged 2 commits into from
Nov 26, 2018

Conversation

manthey
Copy link
Contributor

@manthey manthey commented Nov 20, 2018

This reduces code duplication. It has been listed as a TODO in the code for a long time.

m_width = width;
m_height = height;
if (!m_width || !m_height) {
if (!width || !height) {
Copy link
Member

Choose a reason for hiding this comment

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

in vglRenderer we use m_this.width() to get width and height, why not we use the same here? instead of getting it from map?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A few lines later is where the layer's width and height is set from these values (m_this._setWidthHeight(width, height);), so width and height are the values that will be set.

Copy link
Member

Choose a reason for hiding this comment

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

I see, I was expecting the flow between vgl and d3 renderers would be same and may be they are similar. so sounds like we are getting the width and height from the map and set it to the renderer in both cases?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes.

Copy link
Member

@aashish24 aashish24 left a comment

Choose a reason for hiding this comment

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

looks great, just had a minor suggestion for consistency which may be a valid argument

@manthey manthey merged commit 708a2d2 into master Nov 26, 2018
@manthey manthey deleted the renderer-width-height branch November 26, 2018 21:15
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