(self, gc, marker_path, marker_trans, path, transform,
rgbFace=None)
| 155 | ctx.stroke() |
| 156 | |
| 157 | def draw_markers(self, gc, marker_path, marker_trans, path, transform, |
| 158 | rgbFace=None): |
| 159 | # docstring inherited |
| 160 | |
| 161 | ctx = gc.ctx |
| 162 | ctx.new_path() |
| 163 | # Create the path for the marker; it needs to be flipped here already! |
| 164 | _append_path(ctx, marker_path, marker_trans + Affine2D().scale(1, -1)) |
| 165 | marker_path = ctx.copy_path_flat() |
| 166 | |
| 167 | # Figure out whether the path has a fill |
| 168 | x1, y1, x2, y2 = ctx.fill_extents() |
| 169 | if x1 == 0 and y1 == 0 and x2 == 0 and y2 == 0: |
| 170 | filled = False |
| 171 | # No fill, just unset this (so we don't try to fill it later on) |
| 172 | rgbFace = None |
| 173 | else: |
| 174 | filled = True |
| 175 | |
| 176 | transform = (transform |
| 177 | + Affine2D().scale(1, -1).translate(0, self.height)) |
| 178 | |
| 179 | ctx.new_path() |
| 180 | for i, (vertices, codes) in enumerate( |
| 181 | path.iter_segments(transform, simplify=False)): |
| 182 | if len(vertices): |
| 183 | x, y = vertices[-2:] |
| 184 | ctx.save() |
| 185 | |
| 186 | # Translate and apply path |
| 187 | ctx.translate(x, y) |
| 188 | ctx.append_path(marker_path) |
| 189 | |
| 190 | ctx.restore() |
| 191 | |
| 192 | # Slower code path if there is a fill; we need to draw |
| 193 | # the fill and stroke for each marker at the same time. |
| 194 | # Also flush out the drawing every once in a while to |
| 195 | # prevent the paths from getting way too long. |
| 196 | if filled or i % 1000 == 0: |
| 197 | self._fill_and_stroke( |
| 198 | ctx, rgbFace, gc.get_alpha(), gc.get_forced_alpha()) |
| 199 | |
| 200 | # Fast path, if there is no fill, draw everything in one step |
| 201 | if not filled: |
| 202 | self._fill_and_stroke( |
| 203 | ctx, rgbFace, gc.get_alpha(), gc.get_forced_alpha()) |
| 204 | |
| 205 | def draw_image(self, gc, x, y, im): |
| 206 | im = cbook._unmultiplied_rgba8888_to_premultiplied_argb32(im[::-1]) |
nothing calls this directly
no test coverage detected