#include "layers.hpp"
#include "json_helper.hpp"
-#include "hmi-debug.h"
+#include "util.hpp"
namespace wm
{
return l;
});
}
- HMI_DEBUG("wm", "layer_id:%d is_normal_layout_only:%d\n",
+ HMI_DEBUG("layer_id:%d is_normal_layout_only:%d\n",
this->layer_id, this->is_normal_layout_only);
}
auto re = std::regex(r.first);
if (std::regex_match(role, re))
{
- HMI_DEBUG("wm", "role %s matches layer %d", role.c_str(), r.second);
+ HMI_DEBUG("role %s matches layer %d", role.c_str(), r.second);
return optional<int>(r.second);
}
}
- HMI_DEBUG("wm", "role %s does NOT match any layer", role.c_str());
+ HMI_DEBUG("role %s does NOT match any layer", role.c_str());
return nullopt;
}
return j;
}
-void layer_map::setupArea(int output_w, int output_h)
+void layer_map::setupArea(double scaling)
{
compositor::rect rct;
for (auto &i : this->area2size)
{
+ i.second.x = static_cast<int>(scaling * i.second.x + 0.5);
+ i.second.y = static_cast<int>(scaling * i.second.y + 0.5);
+ i.second.w = static_cast<int>(scaling * i.second.w + 0.5);
+ i.second.h = static_cast<int>(scaling * i.second.h + 0.5);
+
HMI_DEBUG("wm:lm", "area:%s size(after) : x:%d y:%d w:%d h:%d",
i.first.c_str(), i.second.x, i.second.y, i.second.w, i.second.h);
}