From c939f18d92939c9abe48ea5af4f7effe435ede69 Mon Sep 17 00:00:00 2001 From: Shallowmallow Date: Fri, 3 May 2024 17:50:05 +0200 Subject: [PATCH] for media queries, min-width=1200 should work when width==1200 --- haxe/ui/styles/elements/MediaQuery.hx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/haxe/ui/styles/elements/MediaQuery.hx b/haxe/ui/styles/elements/MediaQuery.hx index 8a5ae4518..5fab11c6f 100644 --- a/haxe/ui/styles/elements/MediaQuery.hx +++ b/haxe/ui/styles/elements/MediaQuery.hx @@ -22,16 +22,16 @@ class MediaQuery { for (d in _directives) { switch (d.directive) { case "min-width": - b = b && (Screen.instance.width > ValueTools.calcDimension(d.value)); + b = b && (Screen.instance.width >= ValueTools.calcDimension(d.value)); case "max-width": b = b && (Screen.instance.width < ValueTools.calcDimension(d.value)); case "min-height": - b = b && (Screen.instance.height > ValueTools.calcDimension(d.value)); + b = b && (Screen.instance.height >= ValueTools.calcDimension(d.value)); case "max-height": b = b && (Screen.instance.height < ValueTools.calcDimension(d.value)); case "min-aspect-ratio": var sr = Screen.instance.width / Screen.instance.height; - b = b && (sr > buildRatio(ValueTools.string(d.value))); + b = b && (sr >= buildRatio(ValueTools.string(d.value))); case "max-aspect-ratio": var sr = Screen.instance.width / Screen.instance.height; b = b && (sr < buildRatio(ValueTools.string(d.value)));