Logo Search packages:      
Sourcecode: ktechlab version File versions

QPoint ItemView::mousePosToCanvasPos ( const QPoint &  contentsClick  )  const [inherited]

Converts a mouse click position (in the contents coordinates) to the associated position on the canvas.

Definition at line 132 of file itemview.cpp.

References ItemView::zoomLevel().

Referenced by ItemView::createDragItem(), ItemView::dropEvent(), and ItemDocument::resizeCanvasToItems().

      QPoint offsetPos = contentsClick + QPoint( cvbEditor()->contentsX(), cvbEditor()->contentsY() );
      return (offsetPos / zoomLevel()) + p_itemDocument->canvas()->rect().topLeft();

Generated by  Doxygen 1.6.0   Back to index