Skip to content

Commit

Permalink
0.3.schem netlabel
Browse files Browse the repository at this point in the history
  • Loading branch information
irascible committed Jan 6, 2014
1 parent ee10b29 commit e70eec4
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 10 deletions.
3 changes: 3 additions & 0 deletions phoenixresources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,9 @@
<file>resources/parts/svg/core/schematic/power.svg</file>
<file>resources/parts/svg/core/schematic/frame.svg</file>
<file>resources/parts/svg/core/schematic/schematiclogo.svg</file>

<file>resources/parts/svg/obsolete/schematic/0.3.schem.netlabel.svg</file>

<file>resources/styles/fritzing.qss</file>
<file>resources/styles/partseditor.qss</file>
<file>resources/styles/newpartseditor.qss</file>
Expand Down
11 changes: 11 additions & 0 deletions resources/parts/svg/obsolete/schematic/0.3.schem.netlabel.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/fsvgrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -624,9 +624,9 @@ bool FSvgRenderer::setUpConnector(SvgIdLayer * svgIdLayer, bool ignoreTerminalPo

if (svgIdLayer == NULL) return false;

if (svgIdLayer->m_viewID = ViewLayer::SchematicView) {
DebugDialog::debug("delete me please");
}
//if (svgIdLayer->m_viewID = ViewLayer::SchematicView) {
// DebugDialog::debug("delete me please");
//}

if (svgIdLayer->processed(viewLayerPlacement)) {
// hybrids are not visible in some views
Expand Down
19 changes: 12 additions & 7 deletions src/items/symbolpaletteitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ along with Fritzing. If not, see <http://www.gnu.org/licenses/>.
#include "../utils/graphicsutils.h"
#include "../sketch/infographicsview.h"
#include "partlabel.h"
#include "partfactory.h"
#include "layerkinpaletteitem.h"
#include "../svg/svgfilesplitter.h"

Expand Down Expand Up @@ -541,13 +542,17 @@ NetLabel::~NetLabel() {
}

QString NetLabel::makeSvg(ViewLayer::ViewLayerID viewLayerID) {
static const double labelFontSize = 200;
static const double totalHeight = 300;
static const double arrowWidth = totalHeight / 2;
static const double strokeWidth = 10;
static const double halfStrokeWidth = strokeWidth / 2;
static const double labelOffset = 20;
static const double labelBaseLine = 220;

DebugDialog::debug("moduleid " + this->moduleID());
double divisor = moduleID().contains(PartFactory::OldSchematicPrefix) ? 1 : 3;

double labelFontSize = 200 /divisor;
double totalHeight = 300 / divisor;
double arrowWidth = totalHeight / 2;
double strokeWidth = 10 / divisor;
double halfStrokeWidth = strokeWidth / 2;
double labelOffset = 20 / divisor;
double labelBaseLine = 220 / divisor;

QFont font("Droid Sans", labelFontSize * 72 / GraphicsUtils::StandardFritzingDPI, QFont::Normal);
QFontMetricsF fm(font);
Expand Down
8 changes: 8 additions & 0 deletions src/model/modelbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,14 @@ ModelPart * ModelBase::createOldSchematicPart(ModelPart * modelPart, QString & m
return oldModelPart;
}

oldSvgPath = ":resources/parts/svg/obsolete/"+ schematicFilename;
oldModelPart = createOldSchematicPartAux(modelPart, oldModuleIDRef, schematicFilename, oldSvgPath);
if (oldModelPart) {
moduleIDRef = oldModuleIDRef;
return oldModelPart;
}


// see whether it's a generated part
oldSvgPath = PartFactory::getSvgFilename(schematicFilename);
if (!oldSvgPath.isEmpty()) {
Expand Down

0 comments on commit e70eec4

Please sign in to comment.