Skip to content

Commit 20a5e5d

Browse files
authored
fix: GridSize change, show brightness compensation (#746)
* show brightness compensation and set to 0 * New gridLayout calculation and px limiter
1 parent 133399c commit 20a5e5d

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

include/utils/hyperion.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,18 @@ namespace hyperion {
259259
QSize gridSize( midPointsX.size(), midPointsY.size() );
260260
//Debug(_log, "LED layout grid size: %dx%d", gridSize.width(), gridSize.height());
261261

262+
// Limit to 80px for performance reasons
263+
const int pl = 80;
264+
if(gridSize.width() > pl || gridSize.height() > pl)
265+
gridSize.scale(pl, pl, Qt::KeepAspectRatio);
266+
267+
// Correct the grid in case it is malformed in width vs height
268+
// Expected is at least 50% of width <-> height
269+
if((gridSize.width() / gridSize.height()) > 2)
270+
gridSize.setHeight(qMax(1,gridSize.width()/2));
271+
else if((gridSize.width() / gridSize.height()) < 0.5)
272+
gridSize.setWidth(qMax(1,gridSize.height()/2));
273+
262274
return gridSize;
263275
}
264276
};

libsrc/hyperion/schema/schema-color.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,8 @@
195195
"required" : true,
196196
"minimum" : 0,
197197
"maximum": 100,
198-
"default" : 90,
198+
"default" : 0,
199199
"append" : "edt_append_percent",
200-
"access" : "advanced",
201200
"propertyOrder" : 14
202201
},
203202
"gammaRed" :

0 commit comments

Comments
 (0)