layout 2+1
This commit is contained in:
@@ -270,5 +270,11 @@ rect_t Layout::getMainZone(rect_t zone) const
|
||||
zone.x += TRIM_SQUARE_SIZE;
|
||||
}
|
||||
|
||||
if (zone.w % 2 != 0)
|
||||
zone.w -= 1;
|
||||
|
||||
if (zone.h % 2 != 0)
|
||||
zone.h -= 1;
|
||||
|
||||
return zone;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
#define HAS_TRIMS() (persistentData->options[3].value.boolValue == true)
|
||||
#define IS_MIRRORED() (persistentData->options[4].value.boolValue == true)
|
||||
|
||||
constexpr coord_t border = 10;
|
||||
|
||||
const uint8_t LBM_LAYOUT_2P1[] = {
|
||||
#include "mask_layout2+1.lbm"
|
||||
};
|
||||
@@ -37,12 +39,6 @@ const ZoneOption OPTIONS_LAYOUT_2P1[] = {
|
||||
LAYOUT_OPTIONS_END
|
||||
};
|
||||
|
||||
const rect_t ZONES_LAYOUT_2P1[3] = {
|
||||
{ 240, 60, 192, 152 },
|
||||
{ 48, 60, 180, 70 },
|
||||
{ 48, 142, 180, 70 }
|
||||
};
|
||||
|
||||
class Layout2P1: public Layout
|
||||
{
|
||||
public:
|
||||
@@ -65,12 +61,27 @@ class Layout2P1: public Layout
|
||||
|
||||
unsigned int getZonesCount() const override
|
||||
{
|
||||
return DIM(ZONES_LAYOUT_2P1);
|
||||
return 3;
|
||||
}
|
||||
|
||||
rect_t getZone(unsigned int index) const override
|
||||
{
|
||||
return ZONES_LAYOUT_2P1[index];
|
||||
if (IS_MIRRORED())
|
||||
index = 2 - index;
|
||||
|
||||
rect_t zone = getMainZone({border, border, LCD_W - 2 * border, LCD_H - 2 * border});
|
||||
|
||||
if (index == 0) {
|
||||
return {zone.x, zone.y,zone.w / 2, zone.h};
|
||||
}
|
||||
else if (index == 1) {
|
||||
return {zone.x + zone.w / 2, zone.y,zone.w / 2, zone.h / 2};
|
||||
}
|
||||
else {
|
||||
return {zone.x + zone.w / 2, zone.y + zone.h / 2,zone.w / 2, zone.h / 2};
|
||||
}
|
||||
|
||||
return zone;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user