Grow by a factor of 2
This reduces the amount of growing necessary for large glyphs
This commit is contained in:
parent
b15437b87f
commit
ca5f82e5e9
1 changed files with 4 additions and 2 deletions
|
@ -131,8 +131,10 @@ impl InnerAtlas {
|
|||
return false;
|
||||
}
|
||||
|
||||
// TODO: Better resizing logic (?)
|
||||
let new_size = (self.size + Self::INITIAL_SIZE).min(self.max_texture_dimension_2d);
|
||||
// Grow each dimension by a factor of 2. The growth factor was chosen to match the growth
|
||||
// factor of `Vec`.`
|
||||
const GROWTH_FACTOR: u32 = 2;
|
||||
let new_size = (self.size * GROWTH_FACTOR).min(self.max_texture_dimension_2d);
|
||||
|
||||
self.packer.grow(size2(new_size as i32, new_size as i32));
|
||||
|
||||
|
|
Loading…
Reference in a new issue