Browse Source

Merge pull request #7179 from RaananW/svg-png

PNG support for browsers not supporting SVG
David Catuhe 5 years ago
parent
commit
f6edd845b8

+ 1 - 0
dist/preview release/what's new.md

@@ -46,6 +46,7 @@
 - Added `RawTexture2DArray` to enable use of WebGL2 2D array textures by custom shaders ([atg](https://github.com/atg))
 - Added multiview support for the shader material (and the line-mesh class) ([RaananW](https://github.com/RaananW/))
 - Added various (interpolation) functions to Path3D, also `alignTangentsWithPath`, `slice`, `getClosestPositionTo` ([Poolminer](https://github.com/Poolminer/))
+- PNG support for browsers not supporting SVG ([RaananW](https://github.com/RaananW/))
 
 ### Engine
 

+ 1 - 1
gui/src/2D/controls/image.ts

@@ -378,7 +378,7 @@ export class Image extends Control {
      * Checks for svg document with icon id present
      */
     private _svgCheck(value: string): string {
-        if ((value.search(/.svg#/gi) !== -1) && (value.indexOf("#") === value.lastIndexOf("#"))) {
+        if (window.SVGSVGElement && (value.search(/.svg#/gi) !== -1) && (value.indexOf("#") === value.lastIndexOf("#"))) {
             var svgsrc = value.split('#')[0];
             var elemid = value.split('#')[1];
             // check if object alr exist in document

File diff suppressed because it is too large
+ 3 - 1
src/Audio/audioEngine.ts


File diff suppressed because it is too large
+ 5 - 4
src/Cameras/VR/vrExperienceHelper.ts


File diff suppressed because it is too large
+ 2 - 1
src/Cameras/XR/webXREnterExitUI.ts


File diff suppressed because it is too large
+ 2 - 2
src/Loading/loadingScreen.ts