Skip to content

Commit

Permalink
fixed bug in SVGLoader
Browse files Browse the repository at this point in the history
added c_instance to rectangles shader
  • Loading branch information
edwin committed May 28, 2018
1 parent a650ff0 commit 7cfbdea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,8 @@ void main(void) {
vec4 x_fill = u_fill; // imageMap;
x_fill.a *= imageMap;
vec4 x_stroke = u_stroke;
int c_charID = int(va_position.z);
{
${shadeStructure.fragmentTransform?:""}
}
Expand Down Expand Up @@ -297,10 +299,13 @@ ${shadeStructure.varyingIn?:""}
${transformVaryingIn}
out vec4 o_color;
flat in int v_instance;
void main(void) {
int c_instance = v_instance;
vec2 c_screenPosition = gl_FragCoord.xy;
float c_contourPosition = 0.0;
vec2 c_boundsPosition = va_position.xy;
vec4 x_fill = u_fill;
vec4 x_stroke = u_stroke;
{
Expand Down Expand Up @@ -330,10 +335,13 @@ ${shadeStructure.attributes?:""}
${shadeStructure.uniforms?:""}
${shadeStructure.varyingOut?:""}
${transformVaryingOut}
flat out int v_instance;
void main() {
${shadeStructure.varyingBridge?:""}
${preTransform}
v_instance = gl_InstanceID;
vec3 x_normal = vec3(0.0, 0.0, 1.0);
vec3 x_position = a_position * vec3(i_dimensions,1.0) + i_offset;
{
Expand Down
1 change: 1 addition & 0 deletions openrndr-svg/src/main/kotlin/org/openrndr/svg/SVGLoader.kt
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ internal class SVGLoader {
val path = SVGPath().apply {
id = e.id()
parseDrawAttributes(e)
parseTransform(e)
commands.add(Command("M", points[0].x, points[0].y))
(1 until points.size).mapTo(commands) { Command("L", points[it].x, points[it].y) }
commands.add(Command("Z"))
Expand Down

0 comments on commit 7cfbdea

Please sign in to comment.