mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
Replace some Point2D::new(0, 0)
instances with Point2D::zero()
(#33783)
Signed-off-by: hackerbirds <120066692+hackerbirds@users.noreply.github.com>
This commit is contained in:
parent
b58cee48ce
commit
1668b12ded
4 changed files with 5 additions and 5 deletions
|
@ -285,7 +285,7 @@ mod test {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test() {
|
fn test() {
|
||||||
let pos = Point2D::new(0, 0);
|
let pos = Point2D::zero();
|
||||||
let viewport = Size2D::new(800, 600);
|
let viewport = Size2D::new(800, 600);
|
||||||
let screen = Size2D::new(1080, 720);
|
let screen = Size2D::new(1080, 720);
|
||||||
let coordinates = EmbedderCoordinates {
|
let coordinates = EmbedderCoordinates {
|
||||||
|
|
|
@ -612,7 +612,7 @@ impl CanvasState {
|
||||||
dh: f64,
|
dh: f64,
|
||||||
) -> (Rect<f64>, Rect<f64>) {
|
) -> (Rect<f64>, Rect<f64>) {
|
||||||
let image_rect = Rect::new(
|
let image_rect = Rect::new(
|
||||||
Point2D::new(0f64, 0f64),
|
Point2D::zero(),
|
||||||
Size2D::new(image_size.width, image_size.height),
|
Size2D::new(image_size.width, image_size.height),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,7 @@ pub fn view<Eye>(view: &FakeXRViewInit) -> Fallible<MockViewInit<Eye>> {
|
||||||
let size = Size2D::new(view.resolution.width, view.resolution.height);
|
let size = Size2D::new(view.resolution.width, view.resolution.height);
|
||||||
let origin = match view.eye {
|
let origin = match view.eye {
|
||||||
XREye::Right => Point2D::new(size.width, 0),
|
XREye::Right => Point2D::new(size.width, 0),
|
||||||
_ => Point2D::new(0, 0),
|
_ => Point2D::zero(),
|
||||||
};
|
};
|
||||||
let viewport = Rect::new(origin, size);
|
let viewport = Rect::new(origin, size);
|
||||||
|
|
||||||
|
|
|
@ -126,8 +126,8 @@ impl Window {
|
||||||
rendering_context,
|
rendering_context,
|
||||||
event_queue: RefCell::new(vec![]),
|
event_queue: RefCell::new(vec![]),
|
||||||
mouse_down_button: Cell::new(None),
|
mouse_down_button: Cell::new(None),
|
||||||
mouse_down_point: Cell::new(Point2D::new(0, 0)),
|
mouse_down_point: Cell::new(Point2D::zero()),
|
||||||
mouse_pos: Cell::new(Point2D::new(0, 0)),
|
mouse_pos: Cell::new(Point2D::zero()),
|
||||||
last_pressed: Cell::new(None),
|
last_pressed: Cell::new(None),
|
||||||
keys_down: RefCell::new(HashMap::new()),
|
keys_down: RefCell::new(HashMap::new()),
|
||||||
animation_state: Cell::new(AnimationState::Idle),
|
animation_state: Cell::new(AnimationState::Idle),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue