Overrides the standard draw_path to add the shadow offset and necessary color changes for the shadow.
(self, renderer, gc, tpath, affine, rgbFace)
| 317 | self._gc = kwargs |
| 318 | |
| 319 | def draw_path(self, renderer, gc, tpath, affine, rgbFace): |
| 320 | """ |
| 321 | Overrides the standard draw_path to add the shadow offset and |
| 322 | necessary color changes for the shadow. |
| 323 | """ |
| 324 | gc0 = renderer.new_gc() # Don't modify gc, but a copy! |
| 325 | gc0.copy_properties(gc) |
| 326 | |
| 327 | if self._shadow_color is None: |
| 328 | r, g, b = (gc0.get_rgb() or (1., 1., 1.))[:3] |
| 329 | # Scale the colors by a factor to improve the shadow effect. |
| 330 | shadow_rgbFace = (r * self._rho, g * self._rho, b * self._rho) |
| 331 | else: |
| 332 | shadow_rgbFace = self._shadow_color |
| 333 | |
| 334 | gc0.set_foreground(mcolors.to_rgba(shadow_rgbFace), isRGBA=True) |
| 335 | gc0.set_alpha(self._alpha) |
| 336 | |
| 337 | gc0 = self._update_gc(gc0, self._gc) |
| 338 | renderer.draw_path( |
| 339 | gc0, tpath, affine + self._offset_transform(renderer)) |
| 340 | gc0.restore() |
| 341 | |
| 342 | |
| 343 | class PathPatchEffect(AbstractPathEffect): |
nothing calls this directly
no test coverage detected