Browse Source

Fix for dropShadows and adjustColor.

clementlandrin 2 years ago
parent
commit
917d2d4e78
1 changed files with 12 additions and 0 deletions
  1. 12 0
      h2d/HtmlText.hx

+ 12 - 0
h2d/HtmlText.hx

@@ -127,6 +127,18 @@ class HtmlText extends Text {
 		glyphs.drawWith(ctx,this);
 	}
 
+	override function getShader< T:hxsl.Shader >( stype : Class<T> ) : T {
+		if (shaders != null) for( s in shaders ) {
+			var c = Std.downcast(s, h3d.shader.ColorMatrix);
+			if ( c != null && !c.enabled )
+				continue;
+			var s = hxd.impl.Api.downcast(s, stype);
+			if( s != null )
+				return s;
+		}
+		return null;
+	}
+
 	/**
 		Method that should return an `h2d.Tile` instance for `<img>` tags. By default calls `HtmlText.defaultLoadImage` method.