# HG changeset patch # User Santeri Piippo # Date 1370115772 -10800 # Node ID f5f2353af0d922a7b0bc196107647c32436856de # Parent 2d71227f35cb180e6a47e1d3b7d550a415a1dc71 fixed: subfiles and radials couldn't be moved, made add-picking with control work again despite its double-use as range picking, changed 'Name' to 'Title' in new part dialog and widened it a bit diff -r 2d71227f35cb -r f5f2353af0d9 changelog.txt --- a/changelog.txt Sat Jun 01 22:01:27 2013 +0300 +++ b/changelog.txt Sat Jun 01 22:42:52 2013 +0300 @@ -12,4 +12,5 @@ - Added ability to snap to pre-existing vertices while drawing. - Replace coords: allow replacing all coords regardless of original value, plus relative moving (offset) - When drawing, drawn vertices now display coordinate labels. -- Calculated coordinates are now rounded down (to prevent stuff like Z:160.000001) \ No newline at end of file +- Calculated coordinates are now rounded down (to prevent stuff like Z:160.000001) +- New part dialog: changed "Name:" to "Title", widened a tad. \ No newline at end of file diff -r 2d71227f35cb -r f5f2353af0d9 src/dialogs.cpp --- a/src/dialogs.cpp Sat Jun 01 22:01:27 2013 +0300 +++ b/src/dialogs.cpp Sat Jun 01 22:42:52 2013 +0300 @@ -243,7 +243,7 @@ } void SetContentsDialog::setObject (LDObject* obj) { - le_contents->setText (obj->getContents ().chars()); + le_contents->setText (obj->raw ().chars()); if (obj->getType() == LDObject::Gibberish) { lb_error->setText (fmt ("%s", @@ -356,9 +356,9 @@ lb_brickIcon = new QLabel; lb_brickIcon->setPixmap (getIcon ("brick")); - lb_name = new QLabel ("Name:"); + lb_name = new QLabel ("Title:"); le_name = new QLineEdit; - le_name->setMinimumWidth (320); + le_name->setMinimumWidth (384); lb_author = new QLabel ("Author:"); le_author = new QLineEdit; diff -r 2d71227f35cb -r f5f2353af0d9 src/extprogs.cpp --- a/src/extprogs.cpp Sat Jun 01 22:01:27 2013 +0300 +++ b/src/extprogs.cpp Sat Jun 01 22:42:52 2013 +0300 @@ -121,7 +121,7 @@ for (LDObject* obj : objs) delete obj; } else { - str line = fmt ("%s\r\n", obj->getContents ().chars ()); + str line = fmt ("%s\r\n", obj->raw ().chars ()); fwrite (line.chars(), 1, ~line, fp); } } diff -r 2d71227f35cb -r f5f2353af0d9 src/file.cpp --- a/src/file.cpp Sat Jun 01 22:01:27 2013 +0300 +++ b/src/file.cpp Sat Jun 01 22:42:52 2013 +0300 @@ -538,7 +538,7 @@ // Write all entries now for (LDObject* obj : objs ()) { // LDraw requires files to have DOS line endings - str line = fmt ("%s\r\n", obj->getContents ().chars ()); + str line = fmt ("%s\r\n", obj->raw ().chars ()); fwrite (line.chars(), 1, line.len (), fp); } @@ -801,7 +801,7 @@ ref->setFileInfo (fileInfo); else { // Couldn't load the file, mark it an error - ref->replace (new LDGibberish (ref->getContents (), "Could not open referred file")); + ref->replace (new LDGibberish (ref->raw (), "Could not open referred file")); } } diff -r 2d71227f35cb -r f5f2353af0d9 src/gldraw.cpp --- a/src/gldraw.cpp Sat Jun 01 22:01:27 2013 +0300 +++ b/src/gldraw.cpp Sat Jun 01 22:42:52 2013 +0300 @@ -897,6 +897,9 @@ case Select: if (!drawOnly ()) { + if (m_totalmove < 10) + m_rangepick = false; + if (!m_rangepick) m_addpick = (m_keymods & Qt::ControlModifier); diff -r 2d71227f35cb -r f5f2353af0d9 src/gui_actions.cpp --- a/src/gui_actions.cpp Sat Jun 01 22:01:27 2013 +0300 +++ b/src/gui_actions.cpp Sat Jun 01 22:42:52 2013 +0300 @@ -343,7 +343,7 @@ } for (LDObject* obj : g_win->sel ()) { - str contents = obj->getContents (); + str contents = obj->raw (); file.write (contents, contents.len ()); file.write ("\r\n", 2); } diff -r 2d71227f35cb -r f5f2353af0d9 src/ldtypes.cpp --- a/src/ldtypes.cpp Sat Jun 01 22:01:27 2013 +0300 +++ b/src/ldtypes.cpp Sat Jun 01 22:42:52 2013 +0300 @@ -73,11 +73,11 @@ } // ============================================================================= -str LDComment::getContents () { +str LDComment::raw () { return fmt ("0 %s", text.chars ()); } -str LDSubfile::getContents () { +str LDSubfile::raw () { str val = fmt ("1 %d %s ", color (), position ().stringRep (false).chars ()); val += transform ().stringRep (); val += ' '; @@ -85,7 +85,7 @@ return val; } -str LDLine::getContents () { +str LDLine::raw () { str val = fmt ("2 %d", color ()); for (ushort i = 0; i < 2; ++i) @@ -94,7 +94,7 @@ return val; } -str LDTriangle::getContents () { +str LDTriangle::raw () { str val = fmt ("3 %d", color ()); for (ushort i = 0; i < 3; ++i) @@ -103,7 +103,7 @@ return val; } -str LDQuad::getContents () { +str LDQuad::raw () { str val = fmt ("4 %d", color ()); for (ushort i = 0; i < 4; ++i) @@ -112,7 +112,7 @@ return val; } -str LDCondLine::getContents () { +str LDCondLine::raw () { str val = fmt ("5 %d", color ()); // Add the coordinates @@ -122,15 +122,15 @@ return val; } -str LDGibberish::getContents () { +str LDGibberish::raw () { return contents; } -str LDVertex::getContents () { +str LDVertex::raw () { return fmt ("0 !LDFORGE VERTEX %d %s", color (), pos.stringRep (false).chars()); } -str LDEmpty::getContents () { +str LDEmpty::raw () { return str (); } @@ -146,7 +146,7 @@ "INVERTNEXT", }; -str LDBFC::getContents () { +str LDBFC::raw () { return fmt ("0 BFC %s", LDBFC::statements[type]); } @@ -643,7 +643,7 @@ // ============================================================================= // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ============================================================================= -str LDRadial::getContents () { +str LDRadial::raw () { return fmt ("0 !LDFORGE RADIAL %s %d %d %d %d %s %s", str (radialTypeName ()).upper ().strip (' ').c (), color (), segments (), divisions (), number (), diff -r 2d71227f35cb -r f5f2353af0d9 src/ldtypes.h --- a/src/ldtypes.h Sat Jun 01 22:01:27 2013 +0300 +++ b/src/ldtypes.h Sat Jun 01 22:42:52 2013 +0300 @@ -28,7 +28,7 @@ virtual LDObject::Type getType () const { \ return LDObject::T; \ } \ - virtual str getContents (); \ + virtual str raw (); \ virtual LD##T* clone () { \ return new LD##T (*this); \ } \ @@ -124,7 +124,7 @@ }; // A string that represents this line - virtual str getContents () { + virtual str raw () { return ""; } diff -r 2d71227f35cb -r f5f2353af0d9 src/types.cpp --- a/src/types.cpp Sat Jun 01 22:01:27 2013 +0300 +++ b/src/types.cpp Sat Jun 01 22:42:52 2013 +0300 @@ -109,8 +109,8 @@ return *this; } -vertex& vertex::operator+ (const vertex& other) const { - vertex newvert = *this; +vertex vertex::operator+ (const vertex& other) const { + vertex newvert (*this); newvert.move (other); return newvert; } diff -r 2d71227f35cb -r f5f2353af0d9 src/types.h --- a/src/types.h Sat Jun 01 22:01:27 2013 +0300 +++ b/src/types.h Sat Jun 01 22:42:52 2013 +0300 @@ -101,7 +101,7 @@ const double& z () const { return m_coords[Z]; } vertex& operator+= (const vertex& other); - vertex& operator+ (const vertex& other) const; + vertex operator+ (const vertex& other) const; vertex operator/ (const double d) const; vertex& operator/= (const double d); bool operator== (const vertex& other) const;