I'm getting an unusual error:
ctx_wrap.fillStyle is not a function
on this line:
ctx_wrap.fillStyle('#b8b8b8');
in here:
...
this.paint = function() {
self.path(ctx_wrap);
if (!isOver) {
ctx_wrap.fillStyle('#b8b8b8');
} else {
ctx_wrap.fillStyle('#d6d6d6');
}
ctx_wrap.fill()
ctx_wrap.stroke();
};
...
What is strange is that, if I ment out that line, the line beneath works. These two lines are nearly identical, but the first one produces the error and the second one works:
ctx_wrap.fillStyle('#b8b8b8');
ctx_wrap.fillStyle('#d6d6d6');
Why would the first line produce the error?
I'm getting an unusual error:
ctx_wrap.fillStyle is not a function
on this line:
ctx_wrap.fillStyle('#b8b8b8');
in here:
...
this.paint = function() {
self.path(ctx_wrap);
if (!isOver) {
ctx_wrap.fillStyle('#b8b8b8');
} else {
ctx_wrap.fillStyle('#d6d6d6');
}
ctx_wrap.fill()
ctx_wrap.stroke();
};
...
What is strange is that, if I ment out that line, the line beneath works. These two lines are nearly identical, but the first one produces the error and the second one works:
ctx_wrap.fillStyle('#b8b8b8');
ctx_wrap.fillStyle('#d6d6d6');
Why would the first line produce the error?
Share Improve this question edited Jun 9, 2017 at 4:14 Pang 10.1k146 gold badges86 silver badges124 bronze badges asked Feb 22, 2017 at 3:28 Michael GaioMichael Gaio 1651 gold badge4 silver badges13 bronze badges 1- How do you get the ctx_wrap object ? By using HTMLCanvasElement.getContext("2d") or special method to draw ? – defghi1977 Commented Feb 22, 2017 at 4:12
1 Answer
Reset to default 9Try using ctx_wrap.fillStyle = "#COLOR"
.
The second one does not work, the console just stops at the first one and spits out the error, because it freaked out from the line of code.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744318752a4568308.html
评论列表(0条)