about summary refs log tree commit diff stats
path: root/src/css
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-08-23 16:14:04 +0200
committerbptato <nincsnevem662@gmail.com>2024-08-23 16:14:04 +0200
commit80b060be33ce7eea7a4bab18dbfe652cf6d36c0b (patch)
tree3e9956660114a48990632d2c15f689146def0f03 /src/css
parentb7c2c15a9c2503c01bb63e9e9c4c04378192a1dd (diff)
downloadchawan-80b060be33ce7eea7a4bab18dbfe652cf6d36c0b.tar.gz
winattrs: un-snakeify
Diffstat (limited to 'src/css')
-rw-r--r--src/css/cascade.nim4
-rw-r--r--src/css/cssvalues.nim8
2 files changed, 6 insertions, 6 deletions
diff --git a/src/css/cascade.nim b/src/css/cascade.nim
index 56430d52..efa9227f 100644
--- a/src/css/cascade.nim
+++ b/src/css/cascade.nim
@@ -46,9 +46,9 @@ func applies(feature: MediaFeature; window: Window): bool =
   of mftPrefersColorScheme:
     return feature.b
   of mftWidth:
-    return feature.appliesLR(window, toLayoutUnit(window.attrs.width_px))
+    return feature.appliesLR(window, window.attrs.widthPx.toLayoutUnit)
   of mftHeight:
-    return feature.appliesLR(window, toLayoutUnit(window.attrs.height_px))
+    return feature.appliesLR(window, window.attrs.heightPx.toLayoutUnit)
   of mftScripting:
     return feature.b == window.settings.scripting
 
diff --git a/src/css/cssvalues.nim b/src/css/cssvalues.nim
index 8caa823a..f0b3cbc8 100644
--- a/src/css/cssvalues.nim
+++ b/src/css/cssvalues.nim
@@ -582,12 +582,12 @@ func px*(l: CSSLength; window: WindowAttributes; p: LayoutUnit): LayoutUnit =
   of cuIn: toLayoutUnit(l.num * 96)
   of cuPc: toLayoutUnit(l.num * 16)
   of cuPt: toLayoutUnit(l.num * 4 / 3)
-  of cuVw: toLayoutUnit(float64(window.width_px) * l.num / 100)
-  of cuVh: toLayoutUnit(float64(window.height_px) * l.num / 100)
+  of cuVw: toLayoutUnit(float64(window.widthPx) * l.num / 100)
+  of cuVh: toLayoutUnit(float64(window.heightPx) * l.num / 100)
   of cuVmin:
-    toLayoutUnit(min(window.width_px, window.height_px) / 100 * l.num)
+    toLayoutUnit(min(window.widthPx, window.heightPx) / 100 * l.num)
   of cuVmax:
-    toLayoutUnit(max(window.width_px, window.height_px) / 100 * l.num)
+    toLayoutUnit(max(window.widthPx, window.heightPx) / 100 * l.num)
 
 func blockify*(display: CSSDisplay): CSSDisplay =
   case display