Esempio n. 1
0
oop CGContextConvertSizeToDeviceSpace_wrap(CGContextRef c, float x, float y) {
  CGSize p = CGContextConvertSizeToDeviceSpace(c, CGSizeMake(x, y));
  objVectorOop r = Memory->objVectorObj->cloneSize(2);
  r->obj_at_put(0, as_floatOop(p.width),  false);
  r->obj_at_put(1, as_floatOop(p.height), false);
  return r;
}
static CGSize alignSizeToUserSpace(CGContextRef context, CGSize s)
{
    // Compute the size in device space.
    s = CGContextConvertSizeToDeviceSpace(context, s);
    // Ensure that size is an integer multiple of device pixels.
    s.width = floor(s.width);
    s.height = floor(s.height);
    // Convert back to user space.
    return CGContextConvertSizeToUserSpace(context, s);
}