summaryrefslogtreecommitdiff
path: root/frontends/cocoa/plotter.m
diff options
context:
space:
mode:
Diffstat (limited to 'frontends/cocoa/plotter.m')
-rw-r--r--frontends/cocoa/plotter.m5
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];