zoomToPublicationViewportPosition

abstract fun zoomToPublicationViewportPosition(x: Length, y: Length, scale: Double, animationOptions: TransformAnimationOptions? = TransformAnimationOptions(), onSuccess: () -> Unit = {}, onError: (ColibrioException) -> Unit = {})

Applies a transform to the ReaderView that will scale and translate publication content so that the specified position is centered in the ReaderView.

This method uses the publication viewport as coordinate system, where (0, 0) is at the top-left of the left-most visible page.

This method accepts relative coordinates in percentage where (0%, 0%) means top-left of the left-most visible page and (100%, 100%) means bottom-right of the right-most visible page.

onSuccess is called when the new active transform has finished animating. onError is called if:

  • canTransform is false.

  • the operation was aborted while animating.

  • The coordinates or scale contained invalid values.

Parameters

x

The X coordinate in the publication viewport.

y

The Y coordinate in the publication viewport.

scale

The desired scale. Normal scale is 1 and bigger numbers means more zoomed in. Values lower than 1 will be capped to 1.

animationOptions

Specifies how the transform should be animated.


abstract suspend fun zoomToPublicationViewportPosition(x: Length, y: Length, scale: Double, animationOptions: TransformAnimationOptions? = TransformAnimationOptions()): ColibrioResult<Unit>

Applies a transform to the ReaderView that will scale and translate publication content so that the specified position is centered in the ReaderView.

This method uses the publication viewport as coordinate system, where (0, 0) is at the top-left of the left-most visible page.

This method accepts relative coordinates in percentage where (0%, 0%) means top-left of the left-most visible page and (100%, 100%) means bottom-right of the right-most visible page.

Returns success result when the new active transform has finished animating. Returns error result if:

  • canTransform is false.

  • the operation was aborted while animating.

  • The coordinates or scale contained invalid values.

Parameters

x

The X coordinate in the publication viewport.

y

The Y coordinate in the publication viewport.

scale

The desired scale. Normal scale is 1 and bigger numbers means more zoomed in. Values lower than 1 will be capped to 1.

animationOptions

Specifies how the transform should be animated.