1// Aseprite
2// Copyright (C) 2020 Igara Studio S.A.
3//
4// This program is distributed under the terms of
5// the End-User License Agreement for Aseprite.
6
7#ifndef APP_UI_EDITOR_VEC2_H_INCLUDED
8#define APP_UI_EDITOR_VEC2_H_INCLUDED
9#pragma once
10
11#include "base/vector2d.h"
12#include "gfx/point.h"
13
14namespace app {
15
16using vec2 = base::Vector2d<double>;
17
18template<typename T>
19inline const vec2 to_vec2(const gfx::PointT<T>& pt) {
20 return vec2(pt.x, pt.y);
21}
22
23inline const gfx::PointF to_point(const vec2& v) {
24 return gfx::PointF(v.x, v.y);
25}
26
27} // namespace app
28
29#endif
30