Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2e1a7a7
Temporary (non generic) fix for FillUseElement
thakral-shubham May 25, 2022
b5b67e0
viewBox translation temporary (non generic fix)
thakral-shubham May 27, 2022
798d7df
Temporary fix for pixelisation issue
thakral-shubham May 27, 2022
141a913
Temporarily added parsing of height and width for image elements till…
thakral-shubham May 27, 2022
833bbb6
Revert "Temporary (non generic) fix for FillUseElement"
thakral-shubham May 30, 2022
957ef6e
Use element/fill issue related temporary fix
thakral-shubham May 31, 2022
233ea9f
FillUseElement temporary (non generic) fix
thakral-shubham May 31, 2022
cd61de8
Adding definition of pRefElement
thakral-shubham May 31, 2022
06cf6ee
Changes for struct forward declaration
thakral-shubham May 31, 2022
c247f82
support of tight bounding boxes for images or handling some glyphs wh…
tjindal Jun 9, 2022
074e357
support number or percentage values for offset/opacity values (#176)
tjindal Jun 9, 2022
3b717b2
Revert "viewBox translation temporary (non generic fix)"
tusharjinda Jun 15, 2022
6766fae
Revert "Temporary fix for pixelisation issue"
tusharjinda Jun 15, 2022
cb64d5a
Fix Bounding Box Issue
anand-milind Sep 16, 2022
bd32ab8
Revert "Fix Bounding Box Issue"
anand-milind Sep 22, 2022
7c80846
Add GetViewBox() to retrieve viewBox dimensions
anand-milind Sep 22, 2022
be71d0d
Dummy commit
anand-milind Sep 23, 2022
bb6c449
Update baseline for image.svg
anand-milind Sep 30, 2022
8ce60fb
Updated config.yml
anand-milind Oct 7, 2022
1fc0232
Merge branch 'main' into thakral/CTchanges
anand-milind Oct 7, 2022
44b94a4
Remove unnecessary whitespace
anand-milind Oct 7, 2022
ca7a864
Fix error introduced during merging
anand-milind Oct 7, 2022
f577dd5
upgrade boost module version
tusharjinda Mar 23, 2023
6103410
update thirdparty submodules boost and cpp-base64
tusharjinda Mar 23, 2023
18f4ca8
Revert "update thirdparty submodules boost and cpp-base64"
tusharjinda Mar 23, 2023
71ea75a
update only boost submodule
tusharjinda Mar 23, 2023
17bec6c
fix in circleCi testcase (#184)
tjindal Mar 23, 2023
09cc3ab
Add C++17 compatibility in addition to C++11 (#194)
dirkschulze Jan 8, 2024
dd676db
boost removal changes
tusharjinda Jun 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use element/fill issue related temporary fix
Taken from commit 4a4bed1 and 3fd71c3
  • Loading branch information
thakral-shubham committed May 31, 2022
commit 957ef6ea110beec4ffed9ec306b006aa21266020
18 changes: 18 additions & 0 deletions svgnative/src/SVGDocumentImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1248,6 +1248,24 @@ void SVGDocumentImpl::TraverseTree(const ColorMap& colorMap, const Element& elem
{
ApplyCSSStyle(reference.classNames, graphicStyle, fillStyle, strokeStyle);
auto saveRestore = SaveRestoreHelper{mRenderer, reference.graphicStyle};
if ((*(refIt->second)).Type() == ElementType::kGraphic)
{
Graphic& graphic = static_cast<Graphic&>(*(refIt->second));
// it will call assignment operator and pass fillStyle from reference to graphic
graphic = reference;
}
else if((*(refIt->second)).Type() == ElementType::kGroup)
{
Group& group = static_cast<Group&>(*(refIt->second));
for (auto& child : group.children)
{
if ((*child).Type() == ElementType::kGraphic)
{
Graphic& graphic = static_cast<Graphic&>(*child);
graphic = reference;
}
}
}
TraverseTree(colorMap, *(refIt->second));
}

Expand Down
58 changes: 58 additions & 0 deletions svgnative/src/SVGDocumentImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,64 @@ class SVGDocumentImpl
std::shared_ptr<Path> path;

ElementType Type() const override { return ElementType::kGraphic; }
Graphic& operator= (const Reference& refObj)
{
if (refObj.fillStyle.hasFill)
{
this->fillStyle.hasFill = refObj.fillStyle.hasFill;
this->fillStyle.internalPaint = refObj.fillStyle.internalPaint;
}
if (refObj.fillStyle.fillRule != WindingRule::kNonZero)
this->fillStyle.fillRule = refObj.fillStyle.fillRule;

if (refObj.fillStyle.fillOpacity != 1.0f)
this->fillStyle.fillOpacity = refObj.fillStyle.fillOpacity;

Color paint = Color{{0, 0, 0, 1.0}};
if (paint != boost::get<Color>(refObj.fillStyle.paint))
this->fillStyle.paint = refObj.fillStyle.paint;

if (refObj.fillStyle.visibility != true)
this->fillStyle.visibility = refObj.fillStyle.visibility;

ColorImpl color = Color{{0.0f, 0.0f, 0.0f, 1.0f}};
if (refObj.fillStyle.color != color)
this->fillStyle.color = refObj.fillStyle.color;

if (refObj.fillStyle.clipRule != WindingRule::kNonZero)
this->fillStyle.clipRule = refObj.fillStyle.clipRule;

if (refObj.strokeStyle.hasStroke)
{
this->strokeStyle.hasStroke = refObj.strokeStyle.hasStroke;
this->strokeStyle.internalPaint = refObj.strokeStyle.internalPaint;
}
if (refObj.strokeStyle.strokeOpacity != 1.0f)
this->strokeStyle.strokeOpacity = refObj.strokeStyle.strokeOpacity;

if (refObj.strokeStyle.lineWidth != 1.0f)
this->strokeStyle.lineWidth = refObj.strokeStyle.lineWidth;

if (refObj.strokeStyle.lineCap != LineCap::kButt)
this->strokeStyle.lineCap = refObj.strokeStyle.lineCap;

if (refObj.strokeStyle.lineJoin != LineJoin::kMiter)
this->strokeStyle.lineJoin = refObj.strokeStyle.lineJoin;

if (refObj.strokeStyle.dashArray.size() != 0)
this->strokeStyle.dashArray = refObj.strokeStyle.dashArray;

if (refObj.strokeStyle.miterLimit != 4.0f)
this->strokeStyle.miterLimit = refObj.strokeStyle.miterLimit;

if (refObj.strokeStyle.dashOffset != 4.0f)
this->strokeStyle.dashOffset = refObj.strokeStyle.dashOffset;

if (paint != boost::get<Color>(refObj.strokeStyle.paint))
this->strokeStyle.paint = refObj.strokeStyle.paint;

return *this;
}
};

struct Reference : public Element
Expand Down