mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-23 19:54:02 -04:00
@@ -2238,6 +2238,12 @@ Singleton {
|
||||
return Math.round(value * s) / s;
|
||||
}
|
||||
|
||||
// the epsilon keeps a value already on the grid from gaining a pixel through float error
|
||||
function pxCeil(value, dpr) {
|
||||
const s = dpr || 1;
|
||||
return Math.ceil(value * s - 0.001) / s;
|
||||
}
|
||||
|
||||
function barWidgetThickness(innerPadding, dpr) {
|
||||
return snapEven(Math.max(20, 26 + innerPadding * 0.6), dpr);
|
||||
}
|
||||
|
||||
@@ -313,6 +313,11 @@ Singleton {
|
||||
}, 0, 3000);
|
||||
}
|
||||
|
||||
// wlr-output reports wl_fixed (1/256 steps), surfaces render at fractional-scale-v1 N/120
|
||||
function fractionalScale(fixedScale) {
|
||||
return Math.round(fixedScale * 120) / 120;
|
||||
}
|
||||
|
||||
function getScreenScale(screen) {
|
||||
if (!screen)
|
||||
return 1;
|
||||
@@ -323,12 +328,12 @@ Singleton {
|
||||
|
||||
const randrScale = randrScales[screen.name];
|
||||
if (randrScale !== undefined && randrScale > 0)
|
||||
return Math.round(randrScale * 20) / 20;
|
||||
return fractionalScale(randrScale);
|
||||
|
||||
if (WlrOutputService.wlrOutputAvailable && screen) {
|
||||
const wlrOutput = WlrOutputService.getOutput(screen.name);
|
||||
if (wlrOutput?.enabled && wlrOutput.scale !== undefined && wlrOutput.scale > 0) {
|
||||
return Math.round(wlrOutput.scale * 20) / 20;
|
||||
return fractionalScale(wlrOutput.scale);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -794,7 +794,7 @@ Item {
|
||||
readonly property real shadowMotionPadding: directionalRevealActive ? 0 : Math.max(0, animationOffset)
|
||||
readonly property real shadowBuffer: Theme.snap(Math.max(popoutHandle.surfacePadding, shadowRenderPadding + shadowMotionPadding), dpr)
|
||||
readonly property real alignedWidth: Theme.px(popupWidth, dpr)
|
||||
readonly property real alignedHeight: Theme.px(popupHeight, dpr)
|
||||
readonly property real alignedHeight: Theme.pxCeil(popupHeight, dpr)
|
||||
readonly property real surfaceBodyWidth: Math.max(alignedWidth, Theme.px(Math.min(minimumSurfaceWidth, screenWidth), dpr))
|
||||
readonly property real surfaceBodyX: Theme.snap(_standaloneAlignedXFor(surfaceBodyWidth), dpr)
|
||||
readonly property real _surfaceOriginX: connected ? 0 : _surfaceX
|
||||
|
||||
Reference in New Issue
Block a user