Skip to content

Broken equality for Point/Rectangle #265

@HeikoKlare

Description

@HeikoKlare

The addition of MonitorAwarePoint / MonitorAwareRectangle breaks equality constraints, see eclipse-platform/eclipse.platform.swt#1711 (comment)

For example, comparing an instance of Rectangle against the results of Shell#getBounds() yields different results depending on whether monitor-specific scaling is activated or not, as in one case a Rectangle is returned while in the other it's a MonitorAwareRectangle.

We should restore correctness of equals/hashCode for Point/Rectangle by only considering x/y values and, in case the monitor is needed for comparison inside the MultiZoomCoordinateSystemMapper, it should only be considered there explicitly. See also eclipse-platform/eclipse.platform.swt#1905

Metadata

Metadata

Assignees

Labels

HiDPIA HiDPI-Related Issue or FeatureSWTIssue for SWT

Type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions