|
|
|
@ -147,8 +147,8 @@ void MyCanvasView::contentsMouseMoveEvent(TQMouseEvent* e)
|
|
|
|
|
|
|
|
|
|
if( statusbar ) {
|
|
|
|
|
LabelUtils l;
|
|
|
|
|
int x = (int)l.pixelToMm( e->x(), TQT_TQPAINTDEVICE(this), LabelUtils::DpiX );
|
|
|
|
|
int y = (int)l.pixelToMm( e->y(), TQT_TQPAINTDEVICE(this), LabelUtils::DpiY );
|
|
|
|
|
int x = (int)l.pixelToMm( e->x(), this, LabelUtils::DpiX );
|
|
|
|
|
int y = (int)l.pixelToMm( e->y(), this, LabelUtils::DpiY );
|
|
|
|
|
statusbar->changeItem( i18n("Position: ") +
|
|
|
|
|
TQString( "%1%2 x %3%4" ).arg( x )
|
|
|
|
|
.arg( Measurements::system() ).arg( y ).arg( Measurements::system()), mouseid );
|
|
|
|
@ -179,8 +179,8 @@ void MyCanvasView::contentsMouseMoveEvent(TQMouseEvent* e)
|
|
|
|
|
|
|
|
|
|
LabelUtils l;
|
|
|
|
|
TQPoint pmm;
|
|
|
|
|
pmm.setX( (int)l.pixelToMm( new_pt.x() - getTranslation().x(), TQT_TQPAINTDEVICE(this), LabelUtils::DpiX ) * 1000 );
|
|
|
|
|
pmm.setY( (int)l.pixelToMm( new_pt.y() - getTranslation().y(), TQT_TQPAINTDEVICE(this), LabelUtils::DpiY ) * 1000 );
|
|
|
|
|
pmm.setX( (int)l.pixelToMm( new_pt.x() - getTranslation().x(), this, LabelUtils::DpiX ) * 1000 );
|
|
|
|
|
pmm.setY( (int)l.pixelToMm( new_pt.y() - getTranslation().y(), this, LabelUtils::DpiY ) * 1000 );
|
|
|
|
|
|
|
|
|
|
// Move the item
|
|
|
|
|
MoveCommand* mv = new MoveCommand( pmm.x() - moving->item()->rectMM().x(),
|
|
|
|
@ -197,8 +197,8 @@ void MyCanvasView::contentsMouseMoveEvent(TQMouseEvent* e)
|
|
|
|
|
LabelUtils l;
|
|
|
|
|
|
|
|
|
|
TQPoint pmm;
|
|
|
|
|
pmm.setX( (int)l.pixelToMm( p.x() - getTranslation().x(), TQT_TQPAINTDEVICE(this), LabelUtils::DpiX ) * 1000 );
|
|
|
|
|
pmm.setY( (int)l.pixelToMm( p.y() - getTranslation().y(), TQT_TQPAINTDEVICE(this), LabelUtils::DpiY ) * 1000 );
|
|
|
|
|
pmm.setX( (int)l.pixelToMm( p.x() - getTranslation().x(), this, LabelUtils::DpiX ) * 1000 );
|
|
|
|
|
pmm.setY( (int)l.pixelToMm( p.y() - getTranslation().y(), this, LabelUtils::DpiY ) * 1000 );
|
|
|
|
|
|
|
|
|
|
TQRect rmm = moving->item()->rectMM();
|
|
|
|
|
ResizeCommand* mv = new ResizeCommand( moving, shift_pressed );
|
|
|
|
@ -399,7 +399,7 @@ void MyCanvasView::updateRuler()
|
|
|
|
|
rulerv->setGeometry( 0, 20, 20, height() - 20 );
|
|
|
|
|
|
|
|
|
|
if( def ) {
|
|
|
|
|
canv->setRect( TQRect( translation.x(), translation.y(), (int)def->getMeasurements().width( TQT_TQPAINTDEVICE(this) ), (int)def->getMeasurements().height( TQT_TQPAINTDEVICE(this) )) );
|
|
|
|
|
canv->setRect( TQRect( translation.x(), translation.y(), (int)def->getMeasurements().width( this ), (int)def->getMeasurements().height( this )) );
|
|
|
|
|
|
|
|
|
|
rulerv->setMaxValue( height() );
|
|
|
|
|
rulerh->setMaxValue( width() );
|
|
|
|
@ -443,16 +443,16 @@ void MyCanvasView::reposition()
|
|
|
|
|
* and multiply with the new one.
|
|
|
|
|
* As a result we have the correct width.
|
|
|
|
|
*/
|
|
|
|
|
int x = int((width() - (def->getMeasurements().width( TQT_TQPAINTDEVICE(this) )) ) / 2);
|
|
|
|
|
int y = int((height() - (def->getMeasurements().height( TQT_TQPAINTDEVICE(this) )) ) / 2);
|
|
|
|
|
int x = int((width() - (def->getMeasurements().width( this )) ) / 2);
|
|
|
|
|
int y = int((height() - (def->getMeasurements().height( this )) ) / 2);
|
|
|
|
|
|
|
|
|
|
// move label 30 pixels away from top/left if necessary
|
|
|
|
|
x = x > 0 ? x : 30;
|
|
|
|
|
y = y > 0 ? y : 30;
|
|
|
|
|
|
|
|
|
|
// make sure that there is some space around the label, therefore at 60 pixel
|
|
|
|
|
int w = ( this->width() - 2 > def->getMeasurements().width( TQT_TQPAINTDEVICE(this) ) ? this->width() - 2 : int(def->getMeasurements().width( TQT_TQPAINTDEVICE(this) ) + 60) );
|
|
|
|
|
int h = ( this->height() - 2 > def->getMeasurements().height( TQT_TQPAINTDEVICE(this) ) ? this->height() - 2 : int(def->getMeasurements().height( TQT_TQPAINTDEVICE(this) ) + 60) );
|
|
|
|
|
int w = ( this->width() - 2 > def->getMeasurements().width( this ) ? this->width() - 2 : int(def->getMeasurements().width( this ) + 60) );
|
|
|
|
|
int h = ( this->height() - 2 > def->getMeasurements().height( this ) ? this->height() - 2 : int(def->getMeasurements().height( this ) + 60) );
|
|
|
|
|
|
|
|
|
|
canvas()->resize( w, h );
|
|
|
|
|
|
|
|
|
|