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

Fixes for tiled blobs #3237

Merged
merged 2 commits into from Oct 29, 2018
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

Avoid floating point precision issues causing TileIterator to return

empty tiles.
  • Loading branch information
mattwoodrow committed Oct 29, 2018
commit d13fcf8aaab5e0991e72bd6bd65bddc93ece94d0
@@ -320,8 +320,25 @@ pub fn tiles(
},
);

let x_count = f32::ceil((visible_rect.max_x() - prim_rect.origin.x) / layer_tile_size.width) as u32 - t0.x;
let y_count = f32::ceil((visible_rect.max_y() - prim_rect.origin.y) / layer_tile_size.height) as u32 - t0.y;
// Since we're working in layer space, we can end up computing leftover tiles with an empty
// size due to floating point precision issues. Detect this case so that we don't return
// tiles with an empty size.
let x_count = {
let result = f32::ceil((visible_rect.max_x() - prim_rect.origin.x) / layer_tile_size.width) as u32 - t0.x;
if result == leftover_offset.x + 1 && leftover_layer_size.width == 0.0f32 {
leftover_offset.x
} else {
result
}
};
let y_count = {
let result = f32::ceil((visible_rect.max_y() - prim_rect.origin.y) / layer_tile_size.height) as u32 - t0.y;
if result == leftover_offset.y + 1 && leftover_layer_size.height == 0.0f32 {
leftover_offset.y
} else {
result
}
};

let mut row_flags = EdgeAaSegmentMask::TOP;
if y_count == 1 {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.