use of org.eclipse.sirius.components.diagrams.layout.incremental.provider.ImageNodeStyleSizeProvider in project sirius-components by eclipse-sirius.
the class ImageNodeStyleSizeProviderTests method testImageNodeStyleScaledSize.
@Test
public void testImageNodeStyleScaledSize() {
ImageNodeStyleSizeProvider imageNodeStyleSizeProvider = new ImageNodeStyleSizeProvider(this.imageSizeProvider);
// @formatter:off
ImageNodeStyle imageNodeStyle = ImageNodeStyle.newImageNodeStyle().imageURL(IMAGE_PNG).scalingFactor(2).build();
// @formatter:on
Size size = imageNodeStyleSizeProvider.getSize(imageNodeStyle);
assertThat(size.getWidth()).isCloseTo(20.0, Offset.offset(0.0001));
}
use of org.eclipse.sirius.components.diagrams.layout.incremental.provider.ImageNodeStyleSizeProvider in project sirius-components by eclipse-sirius.
the class ImageNodeStyleSizeProviderTests method testImageNodeStyleNativeSize.
@Test
public void testImageNodeStyleNativeSize() {
ImageNodeStyleSizeProvider imageNodeStyleSizeProvider = new ImageNodeStyleSizeProvider(this.imageSizeProvider);
// @formatter:off
ImageNodeStyle imageNodeStyle = ImageNodeStyle.newImageNodeStyle().imageURL(IMAGE_PNG).scalingFactor(-1).build();
// @formatter:on
Size size = imageNodeStyleSizeProvider.getSize(imageNodeStyle);
assertThat(size.getWidth()).isCloseTo(42.0, Offset.offset(0.0001));
}
Aggregations