Skip to content

Commit

Permalink
-removed deprecated function from MultiPointHandlerSVG
Browse files Browse the repository at this point in the history
-added a case to mutilPointTester1
  • Loading branch information
Spinelli committed Feb 15, 2017
1 parent be7b6b9 commit f0da7b2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 62 deletions.
9 changes: 9 additions & 0 deletions web/js/src/multiPointTester1.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,14 @@
modifiers["symbolFillIconSize"] = 30;
//modifiers["FILLCOLOR"] = "00000000";
break;
case 6://BBS Rectangle
symbolCode = "BBS_RECTANGLE--";//
controlPoints = "66.26700036208742,30.62755038706961 66.27555681517738,30.64727776502703";
modifiers = {};
var mtg = armyc2.c2sd.renderer.utilities.ModifiersTG;
modifiers[mtg.AM_DISTANCE] = [100];
modifiers["FILLCOLOR"] = "BBFF0000";
break;
default:
break;
}
Expand Down Expand Up @@ -246,6 +254,7 @@
<option value=3>Sector Range Fan</option>
<option value=4>Boundary</option>
<option value=5>Dummy Minefield Dynamic</option>
<option value=6>BBS_RECTANGLE--</option>
</select>
<button type='button' onclick='testRender()'>Test Multipoint</button>
<button type='button' onclick='cleartext()'>Clear</button>
Expand Down
62 changes: 0 additions & 62 deletions web/js/src/sec/web/renderer/MultiPointHandlerSVG.js
Original file line number Diff line number Diff line change
Expand Up @@ -648,69 +648,7 @@ sec.web.renderer.MultiPointHandlerSVG = (function () {
texture += '</defs>';
return texture;
},

/**
* @param Number fillType - forward diagonal (fillStyle=2), backward diagonal (3). We also have capabilities for vertical (4), horizontal (5), and cross (8).
* @param String color "hexString like '#00FF00'";
*/
MakeHatchFillTextureSVG:function(fillType, color)
{
if(!armyc2.c2sd.renderer.MilStdSVGRenderer)
{
return null;
}
//needs to return {dataURI, width, height}
var texture = "";
var symbolIDs = symbolFillIds.split(",");
var symbols = [];
var width = 0, height = 0, spacerW = 0, spacerH = 0;
//calculate texture dimensions
for(var i = 0; i < symbolIDs.length; i++)
{
symbols.push(armyc2.c2sd.renderer.MilStdSVGRenderer.Render(symbolIDs[i],{"SIZE":symbolFillSize}));
var rect = symbols[i].getSVGBounds();
if(rect.getWidth() > width)
width = rect.getWidth();
if(rect.getHeight() > height)
height = rect.getHeight();
}
spacerW = width / 3;
spacerH = 10; //width / 2;


//create texture
//texture = _document.createElement('canvas');
svgWidth = (width * symbols.length) + (spacerW * symbols.length);
svgHeight = height + spacerH;

//draw to texture
var x = spacerW;
var y = spacerH;
//var ctx = texture.getContext('2d');
var pattern = "";
for(var j = 0; j < symbols.length; j++)
{
var sym = symbols[j];
var center = sym.getAnchorPoint();
pattern += '<g transform="translate(' + (x + width/2 - center.getX()) + ' ' + (y + height/2 - center.getY()) + ')" >';

var paths = sym.getSVG();
paths = paths.substr(paths.indexOf("<g"));
paths = paths.replace("</svg>","");

pattern += paths;
pattern += '</g>';
x += spacerW + width;
}

texture = '<defs>';
texture += '<pattern id="fillPattern" patternUnits="userSpaceOnUse" width="' + svgWidth + '" height="' + svgHeight + '" >';
texture += pattern;
texture += '</pattern>';
texture += '</defs>';
return texture;
},

/**
*
* @param {armyc2.c2sd.renderer.so.Rectangle} rectangle
Expand Down

0 comments on commit f0da7b2

Please sign in to comment.