SVG Refactor - minor cleanups

This commit is contained in:
wandererfan
2019-06-08 11:16:51 -04:00
committed by WandererFan
parent ca5051a798
commit 044fe79549
9 changed files with 100 additions and 101 deletions

View File

@@ -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();

View File

@@ -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>;
}

View File

@@ -111,7 +111,10 @@ private:
};
typedef App::FeaturePythonT<DrawPage> DrawPagePython;
} //namespace TechDraw
#endif

View File

@@ -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"

View File

@@ -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_

View File

@@ -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")) {

View File

@@ -1576,14 +1576,12 @@
id="g3298">
<text
freecad:editable="Designed_by_Name"
transform="scale(0.9999956,1.0000044)"
sodipodi:linespacing="125%"
id="text3266"
y="160.67236"
x="147.9312"
style="font-size:5.64441967000000044px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Arial;-inkscape-font-specification:Arial">
style="font-size:3.95px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Arial;-inkscape-font-specification:Arial">
<tspan
style="font-size:3.95109367000000011px;text-anchor:start;text-align:start"
y="160.67236"
x="147.9312"
id="tspan3268"
@@ -1594,9 +1592,8 @@
id="text3270"
y="168.59135"
x="147.93056"
style="font-size:5.64444446999999982px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Arial;-inkscape-font-specification:Arial">
style="font-size:3.95px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Arial;-inkscape-font-specification:Arial">
<tspan
style="font-size:3.95111131999999987px;text-anchor:start;text-align:start"
y="168.59135"
x="147.93056"
id="tspan3272"
@@ -1607,9 +1604,8 @@
id="text3274"
y="191.45177"
x="154.46243"
style="font-size:5.64444447px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Arial;-inkscape-font-specification:Arial">
style="font-size:3.95px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Arial;-inkscape-font-specification:Arial">
<tspan
style="font-size:3.95111132px"
y="191.45177"
x="154.46243"
id="tspan3276"
@@ -1620,9 +1616,8 @@
id="text3278"
y="191.44733"
x="173.94231"
style="font-size:5.64444447px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Arial;-inkscape-font-specification:Arial">
style="font-size:3.95px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Arial;-inkscape-font-specification:Arial">
<tspan
style="font-size:3.95111132px"
y="191.44733"
x="173.94231"
id="tspan3280"

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 74 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 32 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 23 KiB