src/gldraw.cpp

changeset 319
d0f41342ef51
parent 318
de051d2bd80b
child 321
48e429bfd58c
equal deleted inserted replaced
318:de051d2bd80b 319:d0f41342ef51
956 956
957 if (mid || (left && shift)) { 957 if (mid || (left && shift)) {
958 m_panX += 0.03f * dx * (zoom () / 7.5f); 958 m_panX += 0.03f * dx * (zoom () / 7.5f);
959 m_panY -= 0.03f * dy * (zoom () / 7.5f); 959 m_panY -= 0.03f * dy * (zoom () / 7.5f);
960 m_panning = true; 960 m_panning = true;
961 } else if (left && !m_rangepick && camera () == Free) { 961 } elif (left && !m_rangepick && camera () == Free) {
962 m_rotX = m_rotX + (dy); 962 m_rotX = m_rotX + (dy);
963 m_rotY = m_rotY + (dx); 963 m_rotY = m_rotY + (dx);
964 964
965 clampAngle (m_rotX); 965 clampAngle (m_rotX);
966 clampAngle (m_rotY); 966 clampAngle (m_rotY);
1271 vector<vertex> verts; 1271 vector<vertex> verts;
1272 1272
1273 if (obj->vertices () >= 2) 1273 if (obj->vertices () >= 2)
1274 for (int i = 0; i < obj->vertices (); ++i) 1274 for (int i = 0; i < obj->vertices (); ++i)
1275 verts << obj->getVertex (i); 1275 verts << obj->getVertex (i);
1276 else if( obj->getType() == LDObject::Subfile ) 1276 elif( obj->getType() == LDObject::Subfile )
1277 { 1277 {
1278 vector<LDObject*> objs = static_cast<LDSubfile*>( obj )->inlineContents( true, true ); 1278 vector<LDObject*> objs = static_cast<LDSubfile*>( obj )->inlineContents( true, true );
1279 1279
1280 for( LDObject* obj : objs ) { 1280 for( LDObject* obj : objs ) {
1281 verts << getVertices (obj); 1281 verts << getVertices (obj);
1388 info.oy = y; 1388 info.oy = y;
1389 info.img = img; 1389 info.img = img;
1390 1390
1391 if( info.lw == 0 ) 1391 if( info.lw == 0 )
1392 info.lw = ( info.lh * img->width() ) / img->height(); 1392 info.lw = ( info.lh * img->width() ) / img->height();
1393 else if( info.lh == 0 ) 1393 elif( info.lh == 0 )
1394 info.lh = ( info.lw * img->height() ) / img->width(); 1394 info.lh = ( info.lw * img->height() ) / img->width();
1395 1395
1396 const Axis x2d = cameraAxis( false ), 1396 const Axis x2d = cameraAxis( false ),
1397 y2d = cameraAxis( true ); 1397 y2d = cameraAxis( true );
1398 1398
1641 // If the overlay object was there and the overlay itself is 1641 // If the overlay object was there and the overlay itself is
1642 // not, remove the object. 1642 // not, remove the object.
1643 m_file->forgetObject( ovlobj ); 1643 m_file->forgetObject( ovlobj );
1644 delete ovlobj; 1644 delete ovlobj;
1645 } 1645 }
1646 else if( meta.img && !ovlobj ) 1646 elif( meta.img && !ovlobj )
1647 { 1647 {
1648 // Inverse case: image is there but the overlay object is 1648 // Inverse case: image is there but the overlay object is
1649 // not, thus create the object. 1649 // not, thus create the object.
1650 ovlobj = new LDOverlay; 1650 ovlobj = new LDOverlay;
1651 1651

mercurial