Update text.class.js

Fix text position and added support for text-anchor middle and end.