Skip to content

[Wasm] Fix rectangle clipping regression - #599

Merged
jeromelaban merged 1 commit into
masterfrom
dev/jela/wasm-rectangle-clip
Feb 15, 2019
Merged

jeromelaban merged 1 commit into
masterfrom
dev/jela/wasm-rectangle-clip

Conversation

@jeromelaban

Copy link
Copy Markdown
Member

PR Type

What kind of change does this PR introduce?

  • Bugfix

What is the current behavior?

Rectangles are clipped incorrectly.

What is the new behavior?

Inner rectange SVG is now clipped properly since #594, but the rectangle needs a larger clipping area. The clipping property is now applied properly, if there's one.

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

Internal Issue (If applicable):

// Disable clipping for Scrollviewer (edge seems to disable scrolling if
// the clipping is enabled to the size of the scrollviewer, even if overflow-y is auto)
var clip = this is Controls.ScrollViewer ? (Rect?)null : new Rect(0, 0, newRect.Width, newRect.Height);
Rect? getClip()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do you create a delegate for that ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

... more than a delegate: a display class capturing this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's not a delegate, it's a local function. But it's that or a triple-if with a local variable... I want C# expression pattern matching :(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes you're right it's a local function ... which will be translated as a display class by the compiler, like if you have declared a delegate 🤓

When do we update to C# 8 ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Nope, it's not a like a delegate, there's no indirection, there's a display class, but that's it.

I wrote something like this originally:

var clip = this is Controls.ScrollViewer ? (Rect?)null : Clip != null ? Clip.Rect : new Rect(0, 0, newRect.Width, newRect.Height);

because having to write Rect clip; then a bunch of if else, is not particularly nice either...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👌

// Disable clipping for Scrollviewer (edge seems to disable scrolling if
// the clipping is enabled to the size of the scrollviewer, even if overflow-y is auto)
var clip = this is Controls.ScrollViewer ? (Rect?)null : new Rect(0, 0, newRect.Width, newRect.Height);
Rect? getClip()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

... more than a delegate: a display class capturing this.

Inner rectange SVG is now clipped properly since #594, but the rectangle needs a larger clipping area.
@jeromelaban
jeromelaban force-pushed the dev/jela/wasm-rectangle-clip branch from 3062eb1 to 68da803 Compare February 15, 2019 14:01
@jeromelaban
jeromelaban merged commit ca1c24a into master Feb 15, 2019
@carldebilly
carldebilly deleted the dev/jela/wasm-rectangle-clip branch February 28, 2019 15:53
@carldebilly carldebilly mentioned this pull request Nov 1, 2019
5 of 6 tasks
kazo0 added a commit to kazo0/uno that referenced this pull request Mar 6, 2026
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