more robust handling of extensions; uses width when clientWidth is 0, which sometimes happens when canvas elements are dynamically created
more robust handling of extensions; uses width when clientWidth is 0, which sometimes happens when canvas elements are dynamically created

cscheid/lux,cscheid/lux,cscheid/lux