/// Insert a RasterizedGlyph into the texture atlas
Insert a RasterizedGlyph into the texture atlas
Insert a RasterizedGlyph into the texture atlas
pub fn insert(&mut self,
                  glyph: &RasterizedGlyph,
                  active_tex: &mut u32)
                  -> Result<Glyph, AtlasInsertError>
    {
        if glyph.width > self.width || glyph.height > self.height {
            return Err(AtlasInsertError::GlyphTooLarge);
        }
        // If there's not enough room in current row, go onto next one
        if !self.room_in_row(glyph) {
            self.advance_row()?;
        }
        // If there's still not room, there's nothing that can be done here.
        if !self.room_in_row(glyph) {
            return Err(AtlasInsertError::Full);
        }
        // There appears to be room; load the glyph.
        Ok(self.insert_inner(glyph, active_tex))
    }
pub fn insert ( & mut self , glyph : & RasterizedGlyph , active_tex : & mut u32 ) -> Result < Glyph , AtlasInsertError > { if glyph . width > self . width || glyph . height > self . height { return Err ( AtlasInsertError :: GlyphTooLarge ) ; } // If there's not enough room in current row, go onto next one if ! self . room_in_row ( glyph ) { self . advance_row ( ) ? ; } // If there's still not room, there's nothing that can be done here. if ! self . room_in_row ( glyph ) { return Err ( AtlasInsertError :: Full ) ; } // There appears to be room; load the glyph. Ok ( self . insert_inner ( glyph , active_tex ) ) }
Insert a RasterizedGlyph into the texture atlas
Insert a RasterizedGlyph into the texture atlas
&mut self
glyph
&RasterizedGlyph
active_tex
&mut u32