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

[Mac] GC#fillGradientRectangle don't color for y < 0 #1652

Open
csa-smt opened this issue Dec 12, 2024 · 3 comments · May be fixed by #1655
Open

[Mac] GC#fillGradientRectangle don't color for y < 0 #1652

csa-smt opened this issue Dec 12, 2024 · 3 comments · May be fixed by #1655

Comments

@csa-smt
Copy link

csa-smt commented Dec 12, 2024

Describe the bug

When using GC#fillGradientRectangle with y < 0, color is not applied between y and 0.

By example, this causes a bug in the Eclipse Graphiti library, where you can create diagrams with elements with negative coordinates
https://gitlab.eclipse.org/eclipse/graphiti/graphiti

To Reproduce

In Eclipse SDK :

  1. Help -> Install New Software
  2. Select Graphiti Examples and install it
  3. File -> New -> Other... -> Graphiti Example Diagram
  4. Open the diagram created, and add EClass inside.
  5. Move the EClass higher and scroll so that its y is < 0

Expected behavior

GC#fillGradientRectangle should also color with a y < 0, which is the case on Windows and Linux

Screenshots

In the above screenshot,

  • the y of A is < 0 for its entire height
  • the y of B is < 0 at the beginning then is > 0
  • the y of C is > 0 for its entire height
    Screenshot

Environment:

    • All OS
    • Windows
    • Linux
    • macOS

Additional context

This bug was introduced by commit 4f5f2dc

csa-smt added a commit to Smartesting/eclipse.platform.swt that referenced this issue Dec 12, 2024
…#1652

GC#fillGradientRectangle must be applied for negative y too.

Fixes eclipse-platform#1652
@Phillipus
Copy link
Contributor

Phillipus commented Dec 12, 2024

Could you provide a SWT stand-alone snippet that shows the problem? I would like to make sure that your PR doesn't cause other issues.

This bug was introduced by commit 4f5f2dc

So your PR reverses this and does that cause a regression for that fix?

@csa-smt
Copy link
Author

csa-smt commented Dec 13, 2024

Hi @Phillipus

Could you provide a SWT stand-alone snippet that shows the problem? I would like to make sure that your PR doesn't cause other issues.

Sorry, it’s not so easy to reproduce this with purely SWT code, and I don’t have enough time to do so.
That’s why I relied on examples from Eclipse Graphiti so that you can reproduce the issue yourself and verify that my commit fixes it.

So your PR reverses this and does that cause a regression for that fix?

I have not observed any regression on the bug described in https://bugs.eclipse.org/bugs/show_bug.cgi?id=564885 after applying my changes.
There is no white line in the Dark theme in Eclipse with my changes.
I assume that other changes have been made in Eclipse since commit 4f5f2dc, which means the bug no longer exists.

Additionally, I am questioning the relevance of the fix made in commit 4f5f2dc.
First, based on the discussion in the bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=564885, this commit did not seem to fix the white line issue in all cases.
Second, why paint for x < 0 but not for y < 0? Why paint for y < 0 on Windows and Linux but not on Mac? I’m questioning the consistency of this.

@Phillipus
Copy link
Contributor

I see a white line in the toolbar in our product's custom theme on Mac with your change:

Screenshot 2024-12-13 at 11 22 46

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 a pull request may close this issue.

2 participants