scribble.js
// Helper function to check if image was dropped within the canvas.
Helper function to check if image was dropped within the canvas.
Helper function to check if image was dropped within the canvas .
function droppedOnCanvas(x, y) {
      $canvas = $draw_canvas;
      var border_left = $canvas.offset().left;
      var border_top = $canvas.offset().top;
      var border_right = $canvas.offset().left + $canvas.width();
      var border_bottom = $canvas.offset().top + $canvas.height();
      if (x > border_left && x < border_right && y > border_top && y < border_bottom) {
        return true;
      }
      return false;
    }
function droppedOnCanvas ( x , y ) { $canvas = $draw_canvas ; var border_left = $canvas . offset ( ) . left ; var border_top = $canvas . offset ( ) . top ; var border_right = $canvas . offset ( ) . left + $canvas . width ( ) ; var border_bottom = $canvas . offset ( ) . top + $canvas . height ( ) ; if ( x > border_left && x < border_right && y > border_top && y < border_bottom ) { return true ; } return false ; }
Helper function to check if image was dropped within the canvas.
Helper function to check if image was dropped within the canvas .