Search in sources :

Example 11 with Position

use of org.fxmisc.richtext.model.TwoDimensional.Position in project RichTextFX by FXMisc.

the class TwoLevelNavigatorTest method testZeroOffsetWithBackwardBias.

@Test
public void testZeroOffsetWithBackwardBias() {
    Position pos = navigator.position(3, 0);
    pos = pos.offsetBy(0, Backward);
    assertEquals(2, pos.getMajor());
    assertEquals(10, pos.getMinor());
    // additional zero backward offset should have no effect
    assertEquals(pos, pos.offsetBy(0, Backward));
}
Also used : Position(org.fxmisc.richtext.model.TwoDimensional.Position) Test(org.junit.Test)

Aggregations

Position (org.fxmisc.richtext.model.TwoDimensional.Position)11 Test (org.junit.Test)8 ArrayList (java.util.ArrayList)1 IndexRange (javafx.scene.control.IndexRange)1