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

Add _postMeasure method to GUI Control #14412

Merged
merged 1 commit into from
Oct 12, 2023
Merged

Conversation

pandaGaume
Copy link
Contributor

Adding _postMeasure method to GUI.Control to allow derived classes take some post-measurement actions. This is necessary if we want to change a property such top, after the _measure() action but before the _computeAlignment() call.
Same should be obtained by overriding _measure() or _computeAlignment() into the derived class

 public _measure(): void {
      super._measure();
      this.top = this._i * this._currentMeasure.height ;
 }

but this will not prevent regression later (as it is defined as prefixed _ private method) while the intend of _postMeasure is clear and should be maintened to serve child purposes

so the above code may be replaced with

protected _postMeasure(parentMeasure: Measure, context: ICanvasRenderingContext): void {
     this.top = this._i * this._currentMeasure.height ;
}

@bjsplat
Copy link
Collaborator

bjsplat commented Oct 11, 2023

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Oct 11, 2023

@carolhmj
Copy link
Contributor

LGTM but let's just check with @RaananW 🙂

@carolhmj carolhmj requested a review from RaananW October 11, 2023 20:03
@RaananW RaananW merged commit 6641f36 into BabylonJS:master Oct 12, 2023
10 checks passed
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.

None yet

5 participants