Implement viewport culling (#667)

* culling is working

* fixed tests

* Ready for review

* cleanup

* code review

* Fix import

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
mfish33
2022-06-10 14:38:42 -07:00
committed by Keavon Chambers
co-authored by Keavon Chambers
parent 6f6c67a508
commit a26a0ddfcf
12 changed files with 47 additions and 27 deletions
+2 -2
View File
@@ -42,10 +42,10 @@ impl Default for Document {
impl Document {
/// Wrapper around render, that returns the whole document as a Response.
pub fn render_root(&mut self, mode: ViewMode, font_cache: &FontCache) -> String {
pub fn render_root(&mut self, mode: ViewMode, font_cache: &FontCache, culling_bounds: Option<[DVec2; 2]>) -> String {
let mut svg_defs = String::from("<defs>");
self.root.render(&mut vec![], mode, &mut svg_defs, font_cache);
self.root.render(&mut vec![], mode, &mut svg_defs, font_cache, culling_bounds);
svg_defs.push_str("</defs>");