From 55017976e96018b9f51c62cd1c8e50f48e321387 Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Tue, 5 Oct 2010 11:22:03 -0700 Subject: [PATCH] Fixed miterLimit setter, ignores <= 0 --- src/context2d.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/context2d.cc b/src/context2d.cc index f2bbb80..f92f072 100644 --- a/src/context2d.cc +++ b/src/context2d.cc @@ -242,8 +242,11 @@ Context2d::GetMiterLimit(Local prop, const AccessorInfo &info) { void Context2d::SetMiterLimit(Local prop, Local val, const AccessorInfo &info) { - Context2d *context = ObjectWrap::Unwrap(info.This()); - cairo_set_miter_limit(context->getContext(), val->NumberValue()); + double n = val->NumberValue(); + if (n > 0) { + Context2d *context = ObjectWrap::Unwrap(info.This()); + cairo_set_miter_limit(context->getContext(), n); + } } /*