简体   繁体   中英

destination-out globalCompositeOperation isn't quite what I expect

I'm trying to make a radial progress view. The second arc in the canvas is supposed to clear just a small part of the canvas, but it clears it all out.

I used:

this.ctx.globalCompositeOperation = 'destination-out';

check out this fiddle:

http://jsfiddle.net/8QfFh/

You have an extra call to setValue() at the beginning which sets the initial composite operation. Just save the context and pop it back.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM