mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-19 02:48:12 +08:00
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:
@@ -6,6 +6,8 @@ use crate::message_prelude::*;
|
||||
#[doc(inline)]
|
||||
pub use graphene::DocumentResponse;
|
||||
|
||||
use glam::DVec2;
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
pub struct InputPreprocessorMessageHandler {
|
||||
pub keyboard: KeyStates,
|
||||
@@ -152,4 +154,9 @@ impl InputPreprocessorMessageHandler {
|
||||
responses.push_back(InputMapperMessage::KeyDown(key).into());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn document_bounds(&self) -> [DVec2; 2] {
|
||||
// ipp bounds are relative to the entire screen
|
||||
[(0., 0.).into(), self.viewport_bounds.bottom_right - self.viewport_bounds.top_left]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user