+
+ if(checkclippings) {
+ int clip = 0;
+ if(r.xmax > mbbox.xmax) clip += r.xmax - mbbox.xmax;
+ if(r.ymax > mbbox.ymax) clip += r.ymax - mbbox.ymax;
+ if(r.xmax < mbbox.xmin) clip += -(r.xmax - mbbox.xmin);
+ if(r.ymax < mbbox.ymin) clip += -(r.ymax - mbbox.ymin);
+
+ if(r.xmin > mbbox.xmax) clip += r.xmin = mbbox.xmax;
+ if(r.ymin > mbbox.ymax) clip += r.ymin = mbbox.ymax;
+ if(r.xmin < mbbox.xmin) clip += -(r.xmin = mbbox.xmin);
+ if(r.ymin < mbbox.ymin) clip += -(r.ymin = mbbox.ymin);
+ if(clip > 3*20) {
+ printf("needs clipping: [%.2f %.2f %2.f %2.f] is outside [%.2f %2.f %2.f %2.f]\n",
+ r.xmin / 20.0, r.ymin / 20.0, r.xmax / 20.0, r.ymax / 20.0,
+ mbbox.xmin / 20.0, mbbox.ymin / 20.0, mbbox.xmax / 20.0, mbbox.ymax / 20.0
+ );
+ }
+ }