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

Border width is inconsistent at device pixel ratio 1.5 #4042

Open
SamRodri opened this issue Jul 30, 2020 · 3 comments
Open

Border width is inconsistent at device pixel ratio 1.5 #4042

SamRodri opened this issue Jul 30, 2020 · 3 comments

Comments

@SamRodri
Copy link

In Windows 10 with display scaling set to 150%, this Webrender snippet does not render correctly:

let border_side = BorderSide {
    color: ColorF::new(1.0, 0.0, 0.0, 1.0),
    style: BorderStyle::Solid,
};
let border_widths = LayoutSideOffsets::new_all_same(1.0);
let border_details = BorderDetails::Normal(NormalBorder {
    top: border_side,
    right: border_side,
    bottom: border_side,
    left: border_side,
    radius: BorderRadius::zero(),
    do_aa: true,
});
let bounds = LayoutRect::new(LayoutPoint::new(50.0, 50.0), LayoutSize::new(50.0, 50.0));
builder.push_border(
    &CommonItemProperties::new(
        bounds,
        SpaceAndClipInfo { spatial_id, clip_id: ClipId::root(pipeline_id) },
    ),
    bounds,
    border_widths,
    border_details,
);  

border_error_webrender

Servo also shows this bug servo#27457

@SamRodri
Copy link
Author

SamRodri commented Aug 3, 2020

I implemented pixel snapping in our layout pass and now everything renders correctly.

If there is no interest in handling misaligned input for borders in a more consistent fashion this issue can be closed.

@kvark
Copy link
Member

kvark commented Aug 5, 2020

Maybe @aosmond has an opinion on this :)

@nical
Copy link
Contributor

nical commented Aug 7, 2020

Note that in gecko+WR we don't have this issue because border rectangle sizes are rounded when building the display list.

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

No branches or pull requests

3 participants