Package com.sun.javafx.scene.text

Examples of com.sun.javafx.scene.text.TextLayout


        // workaround for https://javafx-jira.kenai.com/browse/RT-37801
        if(paragraph.length() == 0) {
            return Optional.empty();
        }

        TextLayout textLayout = textLayout();
        HitInfo hit = textLayout.getHitInfo((float)x, (float)y);

        if(hit.getCharIndex() == paragraph.length() - 1) {
            // Might be a hit beyond the end of line, investigate.
            // Workaround for https://javafx-jira.kenai.com/browse/RT-37803
            PathElement[] elems = textLayout.getCaretShape(paragraph.length(), true, 0, 0);
            Path caret = new Path(elems);
            if(x > caret.getBoundsInLocal().getMinX()) {
                return Optional.empty();
            } else {
                return Optional.of(hit);
View Full Code Here

TOP

Related Classes of com.sun.javafx.scene.text.TextLayout

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.