return area2size[area];
}
-void LayerControl::setupArea(double scaling)
+void LayerControl::setupArea(const rectangle& base_rct, double scaling)
{
struct rect rct;
this->scaling = scaling;
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.x = base_rct.left() + static_cast<int>(scaling * i.second.x + 0.5);
+ i.second.y = base_rct.top() + 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);
WMError LayerControl::layoutChange(const WMAction& action)
{
- WMError ret = WMError::FAIL;
if (action.visible == TaskVisible::INVISIBLE)
{
// Visibility is not change -> no redraw is required
// Layout Manager
// WMError ret = this->setLayerSize(layer, action.area);
auto rect = this->getAreaSize(action.area);
- ilmErrorTypes err = ilm_layerSetDestinationRectangle(layer, rect.x, rect.y, rect.w, rect.h);
+ HMI_DEBUG("Set layout %d, %d, %d, %d",rect.x, rect.y, rect.w, rect.h);
+ ilm_layerSetSourceRectangle(layer, rect.x, rect.y, rect.w, rect.h);
+ ilm_layerSetDestinationRectangle(layer, rect.x, rect.y, rect.w, rect.h);
for(auto &wm_layer: this->wm_layers)
{
if(wm_layer->hasLayerID(layer))
ls.setArea(action.client->appID(), action.area);
}
}
- if(err == ILM_SUCCESS)
- {
- ret = WMError::SUCCESS;
- }
- return ret;
+
+ return WMError::SUCCESS;
}
WMError LayerControl::visibilityChange(const WMAction& action)