Skip to content

Commit 4a1b969

Browse files
committed
Custom render values set?
1 parent 3d46304 commit 4a1b969

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/physics/matter-js/lib/constraint/Constraint.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ var Common = require('../core/Common');
6969
lineWidth: 2,
7070
strokeStyle: '#ffffff',
7171
type: 'line',
72-
anchors: true
72+
anchors: true,
73+
custom: false
7374
};
7475

7576
if (constraint.length === 0 && constraint.stiffness > 0.1) {
@@ -79,6 +80,12 @@ var Common = require('../core/Common');
7980
render.type = 'spring';
8081
}
8182

83+
// If the constraint has a render options set, we'll treat it as a custom override
84+
if (constraint.hasOwnProperty('render'))
85+
{
86+
render.custom = true;
87+
}
88+
8289
constraint.render = Common.extend(render, constraint.render);
8390

8491
return constraint;

0 commit comments

Comments
 (0)