Implement unit test for 2nd edge case in #890

This commit is contained in:
Jürg Lehni 2016-01-07 23:19:47 +01:00
parent 6136bd8143
commit 9c1aa47162

View file

@ -339,6 +339,14 @@ test('#889 & #890', function() {
var p = new Path({ segments: [ [732, 418, 0, 0, 0, 52.45802606694065], [676.3444534355956, 552.3444534355972, 34.385686865893945, -34.38568686589349], [630, 704], [400, 704], [542, 228] ], closed: true });
compareBoolean(function() { return cp.subtract(p); },
'M491.6437,396.8l-45.8637,0l-19.78,-136.8l91.51486,50.07693z M676.40276,552.28613c19.70425,20.76653 -42.80276,205.5493 -42.80276,180.51387l27.46296,-130.44906l15.28149,-50.00648c0.01944,-0.01944 0.03887,-0.03888 0.0583,-0.05833z');
var cp = new CompoundPath([
new Path({segments:[[576, 396.8], [345.78, 396.8], [249.6, 243.20000000000002]], closed:true}),
new Path({segments:[[624.84, 550.46], [672, 550.4], [729.6, 608]], closed:true})
]);
var p = new Path({segments:[[323.0000000000002, 228.0000000000001, 0, 0, 51.95879291356505, 0], [410.9999999999998, 704.0000000000002], [-21.000000000000227, 703.9999999999998], [-21.692900774253758, 356.5535001949528]], closed:true});
compareBoolean(function() { return cp.subtract(p); },
'M576,396.8l-199.38152,0c-6.06278,-38.62456 -12.80947,-74.58601 -20.1433,-103.3058z M255.78013,253.06971l-6.18013,-9.86971l14.43275,6.79188z M624.84,550.46l47.16,-0.06l57.6,57.6z');
});
test('frame.intersect(rect);', function() {