]> gitweb.factorcode.org Git - factor.git/commitdiff
images.http: set retina on the mac
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 28 Jan 2022 22:43:25 +0000 (14:43 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 28 Jan 2022 22:43:25 +0000 (14:43 -0800)
extra/images/http/http.factor

index e3d8ea3861ecd92ac7b696adedf74138bfb24348..6ab0bc657144652185ea8e48075be6693b6d3b9f 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors combinators.short-circuit http.client
 images.loader images.loader.private images.viewer io.pathnames
-kernel present sequences strings urls ;
+kernel namespaces opengl present sequences strings urls ;
 IN: images.http
 
 <PRIVATE
@@ -16,7 +16,8 @@ PRIVATE>
 : load-http-image ( path -- image )
     [ http-get swap content-type ]
     [ present file-extension ] bi or
-    (image-class) load-image* ;
+    (image-class) load-image*
+    gl-scale-factor get-global [ 2.0 = >>2x? ] when* ;
 
 M: string set-image
     dup { [ "http://" head? ] [ "https://" head? ] } 1||