小编Hug*_*sti的帖子

使用Batik的文本元素的边界框的错误值

我正在尝试使用getBBox()在文本元素周围绘制一个矩形,代码非常简单,创建文档,添加文本元素,启动文档和添加矩形.问题是getBBox返回一些奇怪的值,我错过了什么?

DOMImplementation impl;
String svgNS;
SVGDocument doc;
Element svgRoot;

UserAgent userAgent;
DocumentLoader loader;
BridgeContext ctx;
GVTBuilder builder;
GraphicsNode rootGN;

...

// get a DOM and create a document
impl = SVGDOMImplementation.getDOMImplementation();
svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
doc = (SVGDocument)impl.createDocument(svgNS, "svg", null);

// Get (the 'svg' element).
svgRoot = doc.getDocumentElement();

// Set the width and height attributes on the root 'svg' element.
svgRoot.setAttributeNS(svgNS, "width", "400");
svgRoot.setAttributeNS(svgNS, "height", "450");

// Add a text element
Element txtElem = doc.createElementNS(svgNS, "text");
txtElem.setAttributeNS(svgNS, "x", "30");
txtElem.setAttributeNS(svgNS, "y", …
Run Code Online (Sandbox Code Playgroud)

java svg batik

5
推荐指数
1
解决办法
2395
查看次数

循环CSS3过渡

我正在尝试循环CSS3转换,想法是在元素中添加一个类来启动转换并监听transitionend事件,当事件被触发时我删除了类并重新开始.

var transition = function () {
    // add class to start the transition
    flipper.addClass('flipped');

    flipper.one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', function () {
        // remove class when transition is done
        flipper.removeClass('flipped');
        transition();
    });
}
Run Code Online (Sandbox Code Playgroud)

这是代码小提琴

问题是它只在第一次运行时,第二次添加类时永远不会触发事件.

有没有其他方法来循环过渡?

jquery css3

2
推荐指数
1
解决办法
183
查看次数

标签 统计

batik ×1

css3 ×1

java ×1

jquery ×1

svg ×1