mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Auto merge of #7909 - paulrouget:subpixelPos, r=mbrubeck
Snap to screen pixels instead of px Fixes #7904 <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7909) <!-- Reviewable:end -->
This commit is contained in:
commit
8ef8c53d2a
4 changed files with 46 additions and 4 deletions
|
@ -279,6 +279,8 @@ impl DisplayList {
|
|||
layer_kind: paint_context.layer_kind,
|
||||
};
|
||||
|
||||
let pixels_per_px = paint_subcontext.screen_pixels_per_px();
|
||||
|
||||
if opts::get().dump_display_list_optimized {
|
||||
self.print(format!("Optimized display list. Tile bounds: {:?}",
|
||||
paint_context.page_rect));
|
||||
|
@ -306,11 +308,11 @@ impl DisplayList {
|
|||
transform.translate(positioned_kid.bounds
|
||||
.origin
|
||||
.x
|
||||
.to_nearest_px() as AzFloat,
|
||||
.to_nearest_pixel(pixels_per_px) as AzFloat,
|
||||
positioned_kid.bounds
|
||||
.origin
|
||||
.y
|
||||
.to_nearest_px() as AzFloat,
|
||||
.to_nearest_pixel(pixels_per_px) as AzFloat,
|
||||
0.0);
|
||||
positioned_kid.optimize_and_draw_into_context(&mut paint_subcontext,
|
||||
&new_transform,
|
||||
|
@ -348,11 +350,11 @@ impl DisplayList {
|
|||
transform.translate(positioned_kid.bounds
|
||||
.origin
|
||||
.x
|
||||
.to_nearest_px() as AzFloat,
|
||||
.to_nearest_pixel(pixels_per_px) as AzFloat,
|
||||
positioned_kid.bounds
|
||||
.origin
|
||||
.y
|
||||
.to_nearest_px() as AzFloat,
|
||||
.to_nearest_pixel(pixels_per_px) as AzFloat,
|
||||
0.0);
|
||||
positioned_kid.optimize_and_draw_into_context(&mut paint_subcontext,
|
||||
&new_transform,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue