X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Flayers.cpp;h=05d404d13bf54e488b82f6b495ef6066ad030da9;hb=845d2b5ed9f70d110fe731b8c5d17694523ce0e5;hp=f73daf2dfdd54bcad220f7c24443a164e5f86ab1;hpb=6e8ca74a266a224d2754a5f2ed0e228fec2e5c96;p=apps%2Fagl-service-windowmanager.git diff --git a/src/layers.cpp b/src/layers.cpp index f73daf2..05d404d 100644 --- a/src/layers.cpp +++ b/src/layers.cpp @@ -18,7 +18,7 @@ #include "layers.hpp" #include "json_helper.hpp" -#include "hmi-debug.h" +#include "util.hpp" namespace wm { @@ -58,7 +58,7 @@ layer::layer(nlohmann::json const &j) 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); } @@ -136,11 +136,11 @@ optional layer_map::get_layer_id(std::string const &role) 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(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; } @@ -181,7 +181,7 @@ json layer_map::to_json() const return j; } -void layer_map::setupArea(int output_w, int output_h) +void layer_map::setupArea(double scaling) { compositor::rect rct; @@ -191,6 +191,11 @@ void layer_map::setupArea(int output_w, int output_h) for (auto &i : this->area2size) { + i.second.x = static_cast(scaling * i.second.x + 0.5); + i.second.y = static_cast(scaling * i.second.y + 0.5); + i.second.w = static_cast(scaling * i.second.w + 0.5); + i.second.h = static_cast(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); }