diff options
author | Sven Weidauer <sven@5sw.de> | 2017-12-23 13:07:23 +0100 |
---|---|---|
committer | Sven Weidauer <sven@5sw.de> | 2017-12-23 13:07:23 +0100 |
commit | 9a50a70be9ee0cafc2f75a2ab282218a31837cb1 (patch) | |
tree | c33d27476179fdbf36a68a671fb6b4acb04118f9 /frontends/cocoa | |
parent | 79bf999c66691df2e9103e3b2fa45b01b0511c26 (diff) | |
download | netsurf-9a50a70be9ee0cafc2f75a2ab282218a31837cb1.tar.gz netsurf-9a50a70be9ee0cafc2f75a2ab282218a31837cb1.tar.bz2 |
Check for empty clip rect.
Diffstat (limited to 'frontends/cocoa')
-rw-r--r-- | frontends/cocoa/plotter.m | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/frontends/cocoa/plotter.m b/frontends/cocoa/plotter.m index a6afbb93a..72577da1a 100644 --- a/frontends/cocoa/plotter.m +++ b/frontends/cocoa/plotter.m @@ -133,6 +133,11 @@ static nserror plot_clip(const struct redraw_context *ctx, const struct rect *cl void cocoa_plot_render_path(NSBezierPath *path, const plot_style_t *pstyle) { + // Quick exit if the clip rect has a zero size. Core Graphics doesn’t like that. + if (cocoa_plot_clip_rect.size.width == 0 || cocoa_plot_clip_rect.size.height == 0) { + return; + } + [NSGraphicsContext saveGraphicsState]; [NSBezierPath clipRect:cocoa_plot_clip_rect]; |