MCPcopy Index your code
hub / github.com/benfry/processing4 / svgToImageMult

Method svgToImageMult

app/src/processing/app/ui/Toolkit.java:797–813  ·  view source on GitHub ↗
(String xmlStr, int wide, int high, StringDict replacements)

Source from the content-addressed store, hash-verified

795
796
797 static public Image svgToImageMult(String xmlStr, int wide, int high, StringDict replacements) {
798 /*
799 for (StringDict.Entry entry : replacements.entries()) {
800 xmlStr = xmlStr.replace(entry.key, entry.value);
801 }
802 */
803 // 2-pass version to avoid re-assigning identical colors
804 // (Otherwise, if a color is set to #666666 before #666666 is
805 // re-assigned to its new color, the swap will happen twice.)
806 for (StringDict.Entry entry : replacements.entries()) {
807 xmlStr = xmlStr.replace(entry.key, "$" + entry.key.hashCode() + "$");
808 }
809 for (StringDict.Entry entry : replacements.entries()) {
810 xmlStr = xmlStr.replace("$" + entry.key.hashCode() + "$", entry.value);
811 }
812 return svgToImage(xmlStr, highResMultiply(wide), highResMultiply(high));
813 }
814
815
816 /**

Callers 4

renderImageMethod · 0.95
renderMonoImageMethod · 0.95
renderImageMethod · 0.95
renderImageMethod · 0.95

Calls 5

svgToImageMethod · 0.95
highResMultiplyMethod · 0.95
entriesMethod · 0.45
replaceMethod · 0.45
hashCodeMethod · 0.45

Tested by

no test coverage detected