1#ifndef YAZE_APP_EDITOR_DUNGEON_DUNGEON_CANVAS_TRANSFORM_H_
2#define YAZE_APP_EDITOR_DUNGEON_DUNGEON_CANVAS_TRANSFORM_H_
7#include "imgui/imgui.h"
29 return ImVec2((screen.x - origin.x) /
scale_,
30 (screen.y - origin.y) /
scale_);
34 ImVec2 screen)
const {
36 return {
static_cast<int>(std::floor(room.x)),
37 static_cast<int>(std::floor(room.y))};
41 int tile_size)
const {
43 return {
static_cast<int>(std::floor(room.x / tile_size)),
44 static_cast<int>(std::floor(room.y / tile_size))};
49 return ImVec2(origin.x + room.x *
scale_, origin.y + room.y *
scale_);
53 return ImVec2(room_size.x *
scale_, room_size.y *
scale_);
Editors are the view controllers for the application.