Skip to content

ResourceNode.StretchType

enum ResourceNode.StretchType
Package: dev.joid.lib.ui.node.impl.resource · Module: core · Source: ResourceNode.java

How an image or a video fills bounds whose ratio differs from its own.

ReturnsSignatureSummary
voiddraw(double x, double y, double width, double height, Resource resource)Draws the resource in these bounds with this fit.
ValueSummary
STRETCHFills the bounds, deforming the image.
CONTAINShows the whole image, centered, as large as the bounds allow; the rest of the bounds stays empty.
COVERFills the bounds with the image, centered, and crops what goes past them.

void draw(double x, double y, double width, double height, Resource resource)

Draws the resource in these bounds with this fit.

STRETCH

Fills the bounds, deforming the image.

CONTAIN

Shows the whole image, centered, as large as the bounds allow; the rest of the bounds stays empty.

COVER

Fills the bounds with the image, centered, and crops what goes past them.


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page