diff --git a/src/firefly/js/drawingLayers/NorthUpCompass.js b/src/firefly/js/drawingLayers/NorthUpCompass.js index 3f3205cb41..aaf2056acd 100644 --- a/src/firefly/js/drawingLayers/NorthUpCompass.js +++ b/src/firefly/js/drawingLayers/NorthUpCompass.js @@ -96,11 +96,5 @@ function makeCompass(plotId, action){ //return Arrays.asList(new DrawObj[]{dataN, dataE}); // - var arrows = VisUtil.getArrowCoords(); - - var pt = makeWorldPt(10.68479, 41.26906);//cc.getWorldCoords(makeImagePt(0, 0)); - var obj = ShapeDataObj.makeCircleWithRadius(pt,50); - var txt = ShapeDataObj.makeText(pt,"Text"); - obj.color = 'yellow'; return [dataE, dataN]; } \ No newline at end of file diff --git a/src/firefly/js/visualize/draw/DirectionArrowDrawObj.js b/src/firefly/js/visualize/draw/DirectionArrowDrawObj.js index 0f015e6d5c..b541d7e652 100644 --- a/src/firefly/js/visualize/draw/DirectionArrowDrawObj.js +++ b/src/firefly/js/visualize/draw/DirectionArrowDrawObj.js @@ -123,11 +123,7 @@ function drawDirectionArrow(ctx,drawTextAry,startPt,endPt,drawParams,renderOptio DrawUtil.drawPath(ctx, color,2,drawList,false, renderOptions); - //DrawUtil.drawText(ctx,ret.textX, ret.textY, color, '9px serif', text, renderOptions); - - //FIXME:color text black on white background - yellow on white background is not readable - //TODO: better solution would be to adapt text color with background - DrawUtil.drawText(drawTextAry, text, ret.textX, ret.textY,'black', renderOptions); + DrawUtil.drawText(drawTextAry, text, ret.textX, ret.textY, color, renderOptions); } function toRegion(startPt,endPt,plot,drawParams,renderOptions) { diff --git a/src/firefly/js/visualize/draw/DrawUtil.js b/src/firefly/js/visualize/draw/DrawUtil.js index 8abc1b3fce..8550fcc9df 100644 --- a/src/firefly/js/visualize/draw/DrawUtil.js +++ b/src/firefly/js/visualize/draw/DrawUtil.js @@ -96,11 +96,14 @@ function drawInnerRecWithHandles(ctx, color, lineWidth, inX1, inY1, inX2, inY2) * @param size * @param fontWeight * @param fontStyle + * @param backGroundColor + * @param padDing */ function drawText(drawTextAry,text, x,y,color, renderOptions, fontFamily='helvetica', size='9px', - fontWeight='normal', fontStyle='normal') { + fontWeight='normal', fontStyle='normal', + backGroundColor, padDing) { //todo @@ -120,11 +123,14 @@ function drawText(drawTextAry,text, x,y,color, 'fontSize': size, fontWeight, fontStyle, - 'backgroundColor': 'white', - 'MozBorderRadius': '5px', - 'borderRadius': '5px', - 'WebkitBorderRadius': '5px' + 'MozBorderRadius': '1px', + 'borderRadius': '1px', + 'WebkitBorderRadius': '1px' }; + + if (backGroundColor) style.backgroundColor = backGroundColor; + if (padDing) style.padding = padDing; + drawTextAry.push({text,style}); } diff --git a/src/firefly/js/visualize/draw/ShapeDataObj.js b/src/firefly/js/visualize/draw/ShapeDataObj.js index f733d521f5..04dfa95452 100644 --- a/src/firefly/js/visualize/draw/ShapeDataObj.js +++ b/src/firefly/js/visualize/draw/ShapeDataObj.js @@ -629,11 +629,7 @@ export function drawText(drawObj, drawTextAry, plot, inPt, drawParams) { if (y > south)y = south; else if (y