Skip to content

Commit

Permalink
SVG Refactor - minor cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
WandererFan committed Jun 11, 2019
1 parent ca5051a commit 044fe79
Show file tree
Hide file tree
Showing 9 changed files with 100 additions and 101 deletions.
1 change: 1 addition & 0 deletions src/Mod/TechDraw/App/AppTechDraw.cpp
Expand Up @@ -97,6 +97,7 @@ PyMOD_INIT_FUNC(TechDraw)
TechDraw::DrawViewImage ::init();

// Python Types
TechDraw::DrawPagePython ::init();
TechDraw::DrawViewPython ::init();
TechDraw::DrawViewPartPython ::init();
TechDraw::DrawViewMultiPython ::init();
Expand Down
12 changes: 12 additions & 0 deletions src/Mod/TechDraw/App/DrawPage.cpp
Expand Up @@ -481,4 +481,16 @@ void DrawPage::Restore(Base::XMLReader &reader)
reader.readEndElement("Properties");
}

// Python Drawing feature ---------------------------------------------------------

namespace App {
/// @cond DOXERR
PROPERTY_SOURCE_TEMPLATE(TechDraw::DrawPagePython, TechDraw::DrawPage)
template<> const char* TechDraw::DrawPagePython::getViewProviderName(void) const {
return "TechDrawGui::ViewProviderPage";
}
/// @endcond

// explicit template instantiation
template class TechDrawExport FeaturePythonT<TechDraw::DrawPage>;
}
3 changes: 3 additions & 0 deletions src/Mod/TechDraw/App/DrawPage.h
Expand Up @@ -111,7 +111,10 @@ class TechDrawExport DrawPage: public App::DocumentObject

};

typedef App::FeaturePythonT<DrawPage> DrawPagePython;

} //namespace TechDraw


#endif

1 change: 1 addition & 0 deletions src/Mod/TechDraw/App/QDomNodeModel.cpp
Expand Up @@ -22,6 +22,7 @@
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// * Used under BSD license 2.0 *

#include "PreCompiled.h"

Expand Down
26 changes: 26 additions & 0 deletions src/Mod/TechDraw/App/QDomNodeModel.h
@@ -1,3 +1,29 @@
// Copyright (c) 2011 Stanislaw Adaszewski, portions (c) 2019 Tomas Pavlicek
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of Stanislaw Adaszewski nor the
// names of other contributors may be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL STANISLAW ADASZEWSKI BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// * Used under BSD license 2.0 *

#ifndef _QDOMNODEMODEL_H_
#define _QDOMNODEMODEL_H_

Expand Down
3 changes: 2 additions & 1 deletion src/Mod/TechDraw/Gui/QGIViewAnnotation.cpp
Expand Up @@ -126,13 +126,14 @@ void QGIViewAnnotation::drawAnnotation()
}

const std::vector<std::string>& annoText = viewAnno->Text.getValues();
int fontSize = calculateFontPixelSize(viewAnno->TextSize.getValue());

//build HTML/CSS formatting around Text lines
std::stringstream ss;
ss << "<html>\n<head>\n<style>\n";
ss << "p {";
ss << "font-family:" << viewAnno->Font.getValue() << "; ";
ss << "font-size:" << Rez::guiX(viewAnno->TextSize.getValue()) << "pt; "; //not really pts???
ss << "font-size:" << fontSize << "px; ";
if (viewAnno->TextStyle.isValue("Normal")) {
ss << "font-weight:normal; font-style:normal; ";
} else if (viewAnno->TextStyle.isValue("Bold")) {
Expand Down
13 changes: 4 additions & 9 deletions src/Mod/TechDraw/Templates/A4_LandscapeTD.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 044fe79

Please sign in to comment.