Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

New Contributor
Posts: 8
Registered: ‎10-21-2011
My Device: Developer
My Carrier: NA

strokeText doesn't work on canvas using BB10 Dev Alpha A

Has anyone else had issues with strokeText on canvas? I have tried everything and have a workaround it just seems like an obvious bug that I'm hoping someone has an answer. Example code attached, when its run on dev alpha only the fill text shows up.


<canvas id="canvas" width="400" height="400"></canvas>
window.addEventListener("DOMContentLoaded", function(){

var canvas = document.getElementById("canvas");
var context = canvas.getContext('2d');

context.fillStyle = 'green';
context.strokeStyle = 'black';
context.lineWidth = 2;
var fontSize = (canvas.height / 8);
context.font = fontSize + 'px Impact';
context.textAlign = 'center';

context.fillText("fillText", 100, 50, canvas.width * .9);
context.strokeText("strokeText", 100, 100, canvas.width * .9);

}, false);

Please use plain text.