(ctx)
| 177 | } |
| 178 | |
| 179 | draw(ctx) { |
| 180 | const {inflateAmount, options: {borderColor, backgroundColor}} = this; |
| 181 | const {inner, outer} = boundingRects(this); |
| 182 | const addRectPath = hasRadius(outer.radius) ? addRoundedRectPath : addNormalRectPath; |
| 183 | |
| 184 | ctx.save(); |
| 185 | |
| 186 | if (outer.w !== inner.w || outer.h !== inner.h) { |
| 187 | ctx.beginPath(); |
| 188 | addRectPath(ctx, inflateRect(outer, inflateAmount, inner)); |
| 189 | ctx.clip(); |
| 190 | addRectPath(ctx, inflateRect(inner, -inflateAmount, outer)); |
| 191 | ctx.fillStyle = borderColor; |
| 192 | ctx.fill('evenodd'); |
| 193 | } |
| 194 | |
| 195 | ctx.beginPath(); |
| 196 | addRectPath(ctx, inflateRect(inner, inflateAmount)); |
| 197 | ctx.fillStyle = backgroundColor; |
| 198 | ctx.fill(); |
| 199 | |
| 200 | ctx.restore(); |
| 201 | } |
| 202 | |
| 203 | inRange(mouseX, mouseY, useFinalPosition) { |
| 204 | return inRange(this, mouseX, mouseY, useFinalPosition); |
nothing calls this directly
no test coverage detected