--- canvasactions.inc	2009-12-28 14:26:53.000000000 +1100
+++ canvasactions.inc.new	2010-11-17 10:58:36.049948069 +1100
@@ -475,6 +475,7 @@ function canvasactions_file2canvas_form(
     'ypos' => '',
     'alpha' => '100',
     'path' => '',
+    'scale' => FALSE,
   );
   $action = array_merge($defaults, (array)$action);
   
@@ -499,6 +500,12 @@ function canvasactions_file2canvas_form(
     '#description' => t('File may be in the "files/" folder, or relative to the Drupal siteroot.'),
     '#element_validate' => array('canvasactions_file2canvas_validate_file'),
   );
+  $form['scale'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('scale'),
+    '#default_value' => $action['scale'],
+    '#description' => t('Check this box to have the overlay scaled to match the underlying canvas.'),
+  );
   return $form;
 }
 
@@ -517,7 +524,7 @@ function canvasactions_file2canvas_valid
  */
 function theme_canvasactions_file2canvas($element) {
   $action = $element['#value'];
-  return '<strong>'. basename($action['path']) . '</strong> x:'. $action['xpos'] .', y:'. $action['ypos'] .' alpha:'. $action['alpha'] .'%' ;
+  return '<strong>'. basename($action['path']) . '</strong> x:'. $action['xpos'] .', y:'. $action['ypos'] .' alpha:'. $action['alpha'] .'%' . ($action['scale'] ? ' (scale)' : '') ;
 }
 
 /**
@@ -541,6 +548,9 @@ function canvasactions_file2canvas_image
     trigger_error(t("Failed to find overlay image %path for imagecache_actions file-to-canvas action. File was not found in the sites 'files' path or the current theme folder.", array('%path' => $action['path'])), E_USER_WARNING);
     return FALSE;
   }
+  if ($action['scale']) {
+    imageapi_image_scale($overlay, $image->info['width'], $image->info['height'], TRUE);
+  }
   return imageapi_image_overlay($image, $overlay, $action['xpos'], $action['ypos'], $action['alpha']);
 }
 
