#include <opdragbx.h>
Inheritance diagram for OpCentredDragBox:
Protected Member Functions | |
OpCentredDragBox () | |
Default constructor for a centred drag-box operation. | |
virtual DocRect | CalcDragBox (const DocCoord &dcStartPos, const DocCoord &dcMousePos) const |
Private Member Functions | |
CC_DECLARE_DYNCREATE (OpCentredDragBox) |
Definition at line 244 of file opdragbx.h.
|
Default constructor for a centred drag-box operation.
Definition at line 700 of file opdragbx.cpp.
|
|
Reimplemented from OpDragBox. Reimplemented in OpZoom. Definition at line 720 of file opdragbx.cpp. 00722 { 00723 // Find the half of the absolute width and height of the drag box. 00724 MILLIPOINT nWidth2 = dcStartPos.x - dcMousePos.x; 00725 if (nWidth2 < 0) nWidth2 = -nWidth2; 00726 MILLIPOINT nHeight2 = dcStartPos.y - dcMousePos.y; 00727 if (nHeight2 < 0) nHeight2 = -nHeight2; 00728 00729 // Return a rectangle of this width and height centre on the click point. 00730 return DocRect(dcStartPos.x - nWidth2, dcStartPos.y - nHeight2, 00731 dcStartPos.x + nWidth2, dcStartPos.y + nHeight2); 00732 }
|
|
|