arcs 0.3.0

An extensible framework for creating 2D CAD applications using the Entity-Component-System pattern.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::{CanvasSpace, DrawingSpace, Point};
use euclid::Scale;
use specs::prelude::*;
use specs_derive::Component;

#[derive(Debug, Clone, PartialEq, Component)]
#[storage(HashMapStorage)]
pub struct Viewport {
    /// The location (in drawing units) this viewport is centred on.
    pub centre: Point,
    /// The number of pixels each drawing unit should take up on the screen.
    pub pixels_per_drawing_unit: Scale<f64, DrawingSpace, CanvasSpace>,
}