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

Adding a filter to a callout breaks the clipping of content #127

Open
ConfidantCommunications opened this issue Aug 31, 2022 · 1 comment
Labels
openfl-bug Something isn't working in OpenFL

Comments

@ConfidantCommunications
Copy link
Contributor

I'm using a custom theme. If I apply a filter to a callout like below, the callout content (inside a Panel) will be shown outside the callout while scrolling. In the project.xml, allowhighdpi is set to true, antialiasing enabled, using openfl shared context.

var dropShadow = new DropShadowFilter(7,45,0,0.9,20,20,1,1,false,false,false);
callout.filters = [dropShadow];
@joshtynjala joshtynjala added the openfl-bug Something isn't working in OpenFL label Sep 7, 2022
@joshtynjala
Copy link
Member

Here's more complete code required to reproduce this issue:

var button:Button;
button = new Button("Click Me", event -> {
	var panel = new Panel();
	panel.width = 70;
	var label = new Label("Hello");
	label.x = 50;
	panel.addChild(label);

	var callout = Callout.show(panel, button);
	var dropShadow = new DropShadowFilter(7, 45, 0, 0.9, 20, 20, 1, 1, false, false, false);
	callout.filters = [dropShadow];
});
addChild(button);

It renders correctly until you start scrolling. Interestingly, after scrolling a bit further, the masking seems to start working again temporarily.

Definitely an OpenFL bug.

The following seems to be a viable workaround until the bug in OpenFL can be fixed:

panel.scrollMode = SCROLL_RECT;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
openfl-bug Something isn't working in OpenFL
Projects
None yet
Development

No branches or pull requests

2 participants