Skip to content

Commit

Permalink
SVG format: Use thicker lines
Browse files Browse the repository at this point in the history
  • Loading branch information
timvdm committed Apr 17, 2011
1 parent 3d823fa commit 62042b6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/depict/depict.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ namespace OpenBabel
orthogonalLine.normalize();
orthogonalLine *= 0.5 * bondWidth;

double lines[7] = { 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70 };
double lines[7] = { 0.20, 0.35, 0.50, 0.65 };

for (int k = 0; k < 7; ++k) {
double w = lines[k];
Expand All @@ -538,9 +538,9 @@ namespace OpenBabel
vector3 vb = end - begin;

if (HasLabel(beginAtom))
begin += 0.26 * vb;
begin += 0.33 * vb;
if (HasLabel(endAtom))
end -= 0.26 * vb;
end -= 0.33 * vb;

if (order == 1) {
painter->DrawLine(begin.x(), begin.y(), end.x(), end.y());
Expand Down Expand Up @@ -581,9 +581,9 @@ namespace OpenBabel

vector3 vbb = end - begin;
if (HasLabel(beginAtom))
begin += 0.26 * vbb;
begin += 0.33 * vbb;
if (HasLabel(endAtom))
end -= 0.26 * vbb;
end -= 0.33 * vbb;
painter->DrawLine(begin.x(), begin.y(), end.x(), end.y());

if (HasLabel(beginAtom))
Expand Down
8 changes: 6 additions & 2 deletions src/depict/svgpainter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ namespace OpenBabel
<< x2 << "\" y2=\"" << y2 << "\"";
if(m_Pencolor!=m_OrigBondcolor)
m_ofs << " stroke=" << MakeRGB(m_Pencolor);
m_ofs << " stroke-width=\"4\"";
m_ofs << " stroke-linecap=\"round\"";
m_ofs << "/>\n";
m_ofs.precision(oldprec);
}
Expand All @@ -116,8 +118,10 @@ namespace OpenBabel
std::vector<std::pair<double,double> >::const_iterator i;
for (i = points.begin(); i != points.end(); ++i)
m_ofs << i->first << ' ' << i->second << ' ';

m_ofs << "\" />\n";
m_ofs << "\"";
m_ofs << " stroke-width=\"4\"";
m_ofs << " stroke-linejoin=\"round\"";
m_ofs << "/>\n";
}

void SVGPainter::DrawCircle(double x, double y, double r)
Expand Down

0 comments on commit 62042b6

Please sign in to comment.