|
@ -38,10 +38,10 @@ class CircularImage extends CircleImageBase { |
|
|
|
|
|
|
|
|
let size = Math.min(0.5*this.height, 0.5*this.width); |
|
|
let size = Math.min(0.5*this.height, 0.5*this.width); |
|
|
|
|
|
|
|
|
// draw the backgroun circle. IMPORTANT: the stroke in this method is used by the clip method below.
|
|
|
|
|
|
|
|
|
// draw the background circle. IMPORTANT: the stroke in this method is used by the clip method below.
|
|
|
this._drawRawCircle(ctx, x, y, selected, hover, size); |
|
|
this._drawRawCircle(ctx, x, y, selected, hover, size); |
|
|
|
|
|
|
|
|
// now we draw in the cicle, we save so we can revert the clip operation after drawing.
|
|
|
|
|
|
|
|
|
// now we draw in the circle, we save so we can revert the clip operation after drawing.
|
|
|
ctx.save(); |
|
|
ctx.save(); |
|
|
// clip is used to use the stroke in drawRawCircle as an area that we can draw in.
|
|
|
// clip is used to use the stroke in drawRawCircle as an area that we can draw in.
|
|
|
ctx.clip(); |
|
|
ctx.clip(); |
|
@ -68,7 +68,7 @@ class CircularImage extends CircleImageBase { |
|
|
|
|
|
|
|
|
distanceToBorder(ctx, angle) { |
|
|
distanceToBorder(ctx, angle) { |
|
|
this.resize(ctx); |
|
|
this.resize(ctx); |
|
|
return this._distanceToBorder(ctx,angle); |
|
|
|
|
|
|
|
|
return this.width * 0.5; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|