mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
fix: GridSize change, show brightness compensation (#746)
* show brightness compensation and set to 0 * New gridLayout calculation and px limiter
This commit is contained in:
@@ -259,6 +259,18 @@ namespace hyperion {
|
||||
QSize gridSize( midPointsX.size(), midPointsY.size() );
|
||||
//Debug(_log, "LED layout grid size: %dx%d", gridSize.width(), gridSize.height());
|
||||
|
||||
// Limit to 80px for performance reasons
|
||||
const int pl = 80;
|
||||
if(gridSize.width() > pl || gridSize.height() > pl)
|
||||
gridSize.scale(pl, pl, Qt::KeepAspectRatio);
|
||||
|
||||
// Correct the grid in case it is malformed in width vs height
|
||||
// Expected is at least 50% of width <-> height
|
||||
if((gridSize.width() / gridSize.height()) > 2)
|
||||
gridSize.setHeight(qMax(1,gridSize.width()/2));
|
||||
else if((gridSize.width() / gridSize.height()) < 0.5)
|
||||
gridSize.setWidth(qMax(1,gridSize.height()/2));
|
||||
|
||||
return gridSize;
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user