Unverified Commit cfdcbc63 authored by Nikolay Igotti's avatar Nikolay Igotti Committed by GitHub

Less internals, cleanup. (#187)

parent 023a1695
......@@ -15,11 +15,11 @@ class AnimationFrameInfo(
* for blending. Any frame from [_requiredFrame, i) can be
* used, unless its getDisposalMethod() is [AnimationDisposalMode.RESTORE_PREVIOUS].
*/
internal var requiredFrame: Int,
var requiredFrame: Int,
/**
* Number of milliseconds to show this frame.
*/
internal var duration: Int,
var duration: Int,
/**
*
* Whether the end marker for this frame is contained in the stream.
......@@ -28,13 +28,13 @@ class AnimationFrameInfo(
* Note: this does not guarantee that an attempt to decode will be complete.
* There could be an error in the stream.
*/
internal var isFullyReceived: Boolean,
var isFullyReceived: Boolean,
/**
*
* This is conservative; it will still return non-opaque if e.g. a
* color index-based frame has a color with alpha but does not use it.
*/
internal var alphaType: ColorAlphaType,
var alphaType: ColorAlphaType,
/**
*
* Whether the updated rectangle contains alpha.
......@@ -45,17 +45,17 @@ class AnimationFrameInfo(
* addition, it may be set to true, even if the final frame, after
* blending, is opaque.
*/
internal var isHasAlphaWithinBounds: Boolean,
var isHasAlphaWithinBounds: Boolean,
/**
*
* How this frame should be modified before decoding the next one.
*/
internal var disposalMethod: AnimationDisposalMode,
var disposalMethod: AnimationDisposalMode,
/**
*
* How this frame should blend with the prior frame.
*/
internal var blendMode: BlendMode,
var blendMode: BlendMode,
/**
*
* The rectangle updated by this frame.
......@@ -85,161 +85,6 @@ class AnimationFrameInfo(
BlendMode.values()[blendModeOrdinal],
frameRect
)
/**
*
* The frame that this frame needs to be blended with, or
* -1 if this frame is independent (so it can be
* drawn over an uninitialized buffer).
*
*
* Note that this is the *earliest* frame that can be used
* for blending. Any frame from [_requiredFrame, i) can be
* used, unless its getDisposalMethod() is [AnimationDisposalMode.RESTORE_PREVIOUS].
*/
/**
* Number of milliseconds to show this frame.
*/
/**
*
* Whether the end marker for this frame is contained in the stream.
*
*
* Note: this does not guarantee that an attempt to decode will be complete.
* There could be an error in the stream.
*/
/**
*
* This is conservative; it will still return non-opaque if e.g. a
* color index-based frame has a color with alpha but does not use it.
*/
/**
*
* Whether the updated rectangle contains alpha.
*
*
* This is conservative; it will still be set to true if e.g. a color
* index-based frame has a color with alpha but does not use it. In
* addition, it may be set to true, even if the final frame, after
* blending, is opaque.
*/
/**
*
* How this frame should be modified before decoding the next one.
*/
/**
*
* How this frame should blend with the prior frame.
*/
/**
*
* The rectangle updated by this frame.
*
*
* It may be empty, if the frame does not change the image. It will
* always be contained by [Codec.getSize].
*/
/**
*
* The frame that this frame needs to be blended with, or
* -1 if this frame is independent (so it can be
* drawn over an uninitialized buffer).
*
*
* Note that this is the *earliest* frame that can be used
* for blending. Any frame from [_requiredFrame, i) can be
* used, unless its getDisposalMethod() is [AnimationDisposalMode.RESTORE_PREVIOUS].
* @return `this`.
*/
fun setRequiredFrame(_requiredFrame: Int): AnimationFrameInfo {
requiredFrame = _requiredFrame
return this
}
/**
* Number of milliseconds to show this frame.
* @return `this`.
*/
fun setDuration(_duration: Int): AnimationFrameInfo {
duration = _duration
return this
}
/**
*
* Whether the end marker for this frame is contained in the stream.
*
*
* Note: this does not guarantee that an attempt to decode will be complete.
* There could be an error in the stream.
* @return `this`.
*/
fun setFullyReceived(_fullyReceived: Boolean): AnimationFrameInfo {
isFullyReceived = _fullyReceived
return this
}
/**
*
* This is conservative; it will still return non-opaque if e.g. a
* color index-based frame has a color with alpha but does not use it.
* @return `this`.
*/
fun setAlphaType(_alphaType: ColorAlphaType): AnimationFrameInfo {
alphaType = _alphaType
return this
}
/**
*
* Whether the updated rectangle contains alpha.
*
*
* This is conservative; it will still be set to true if e.g. a color
* index-based frame has a color with alpha but does not use it. In
* addition, it may be set to true, even if the final frame, after
* blending, is opaque.
* @return `this`.
*/
fun setHasAlphaWithinBounds(_hasAlphaWithinBounds: Boolean): AnimationFrameInfo {
isHasAlphaWithinBounds = _hasAlphaWithinBounds
return this
}
/**
*
* How this frame should be modified before decoding the next one.
* @return `this`.
*/
fun setDisposalMethod(_disposalMethod: AnimationDisposalMode): AnimationFrameInfo {
disposalMethod = _disposalMethod
return this
}
/**
*
* How this frame should blend with the prior frame.
* @return `this`.
*/
fun setBlendMode(_blendMode: BlendMode): AnimationFrameInfo {
blendMode = _blendMode
return this
}
/**
*
* The rectangle updated by this frame.
*
*
* It may be empty, if the frame does not change the image. It will
* always be contained by [Codec.getSize].
* @return `this`.
*/
fun setFrameRect(_frameRect: IRect): AnimationFrameInfo {
frameRect = _frameRect
return this
}
override fun equals(o: Any?): Boolean {
if (o === this) return true
if (o !is AnimationFrameInfo) return false
......
......@@ -556,7 +556,7 @@ class BreakIterator internal constructor(ptr: NativePointer) : Managed(ptr, _Fin
}
}
internal object _FinalizerHolder {
private object _FinalizerHolder {
val PTR = _nGetFinalizer()
}
}
\ No newline at end of file
package org.jetbrains.skia
enum class ColorChannel {
R, G, B, A;
R,
G,
B,
A;
}
\ No newline at end of file
......@@ -22,7 +22,7 @@ package org.jetbrains.skia
* * Nice overview [https://entropymine.com/imageworsener/bicubic/](https://entropymine.com/imageworsener/bicubic/)
*
*/
class CubicResampler(internal val b: Float, internal val c: Float) : SamplingMode {
class CubicResampler(val b: Float, val c: Float) : SamplingMode {
override fun _pack(): Long = (0x8L shl 60) or ((b.toBits().toULong() shl 32) or c.toBits().toULong()).toLong()
......
package org.jetbrains.skia
enum class EncodedImageFormat {
BMP, GIF, ICO, JPEG, PNG, WBMP, WEBP, PKM, KTX, ASTC, DNG, HEIF;
BMP,
GIF,
ICO,
JPEG,
PNG,
WBMP,
WEBP,
PKM,
KTX,
ASTC,
DNG,
HEIF;
}
\ No newline at end of file
......@@ -170,6 +170,6 @@ class FontMetrics(
}
override fun toString(): String {
return "FontMetrics(_top=" + top + ", _ascent=" + ascent + ", _descent=" + descent + ", _bottom=" + bottom + ", _leading=" + leading + ", _avgCharWidth=" + avgCharWidth + ", _maxCharWidth=" + maxCharWidth + ", _xMin=" + xMin + ", _xMax=" + xMax + ", _xHeight=" + xHeight + ", _capHeight=" + capHeight + ", _underlineThickness=" + underlineThickness + ", _underlinePosition=" + underlinePosition + ", _strikeoutThickness=" + strikeoutThickness + ", _strikeoutPosition=" + strikeoutPosition + ")"
return "FontMetrics(_top=$top, _ascent=$ascent, _descent=$descent, _bottom=$bottom, _leading=$leading, _avgCharWidth=$avgCharWidth, _maxCharWidth=$maxCharWidth, _xMin=$xMin, _xMax=$xMax, _xHeight=$xHeight, _capHeight=$capHeight, _underlineThickness=$underlineThickness, _underlinePosition=$underlinePosition, _strikeoutThickness=$strikeoutThickness, _strikeoutPosition=$strikeoutPosition)"
}
}
\ No newline at end of file
package org.jetbrains.skia
enum class FontSlant {
UPRIGHT, ITALIC, OBLIQUE;
UPRIGHT,
ITALIC,
OBLIQUE;
}
\ No newline at end of file
package org.jetbrains.skia
class FontVariationAxis(
internal val _tag: Int,
internal val minValue: Float,
internal val defaultValue: Float,
internal val maxValue: Float,
internal val isHidden: Boolean
val _tag: Int,
val minValue: Float,
val defaultValue: Float,
val maxValue: Float,
val isHidden: Boolean
) {
val tag: String
......
......@@ -11,8 +11,14 @@ enum class GLBackendState(internal val _bit: Int) {
/**
* View state stands for scissor and viewport
*/
VIEW(1 shl 2), BLEND(1 shl 3), MSAA_ENABLE(1 shl 4), VERTEX(1 shl 5), STENCIL(1 shl 6), PIXEL_STORE(1 shl 7), PROGRAM(
1 shl 8
),
FIXED_FUNCTION(1 shl 9), MISC(1 shl 10), PATH_RENDERING(1 shl 11);
VIEW(1 shl 2),
BLEND(1 shl 3),
MSAA_ENABLE(1 shl 4),
VERTEX(1 shl 5),
STENCIL(1 shl 6),
PIXEL_STORE(1 shl 7),
PROGRAM(1 shl 8),
FIXED_FUNCTION(1 shl 9),
MISC(1 shl 10),
PATH_RENDERING(1 shl 11);
}
\ No newline at end of file
package org.jetbrains.skia
class GradientStyle(
internal val tileMode: FilterTileMode,
internal val isPremul: Boolean,
internal val localMatrix: Matrix33?
val tileMode: FilterTileMode,
val isPremul: Boolean,
val localMatrix: Matrix33?
) {
internal fun _getFlags(): Int {
......@@ -11,7 +11,7 @@ class GradientStyle(
}
internal fun _getMatrixArray(): FloatArray? {
return if (localMatrix == null) null else localMatrix.mat
return localMatrix?.mat
}
override fun equals(o: Any?): Boolean {
......@@ -22,10 +22,10 @@ class GradientStyle(
if (isPremul != other.isPremul) return false
val `this$_tileMode`: Any = tileMode
val `other$_tileMode`: Any = other.tileMode
if (if (`this$_tileMode` == null) `other$_tileMode` != null else `this$_tileMode` != `other$_tileMode`) return false
if (`this$_tileMode` != `other$_tileMode`) return false
val `this$_localMatrix`: Any? = localMatrix
val `other$_localMatrix`: Any? = other.localMatrix
return if (if (`this$_localMatrix` == null) `other$_localMatrix` != null else `this$_localMatrix` != `other$_localMatrix`) false else true
return !if (`this$_localMatrix` == null) `other$_localMatrix` != null else `this$_localMatrix` != `other$_localMatrix`
}
protected fun canEqual(other: Any?): Boolean {
......@@ -44,7 +44,7 @@ class GradientStyle(
}
override fun toString(): String {
return "GradientStyle(_tileMode=" + tileMode + ", _premul=" + isPremul + ", _localMatrix=" + localMatrix + ")"
return "GradientStyle(_tileMode=$tileMode, _premul=$isPremul, _localMatrix=$localMatrix)"
}
fun withTileMode(_tileMode: FilterTileMode): GradientStyle {
......
package org.jetbrains.skia
import org.jetbrains.skia.impl.NativePointer
class IPoint(val x: Int, val y: Int) {
fun offset(dx: Int, dy: Int): IPoint {
......
package org.jetbrains.skia
import org.jetbrains.skia.impl.NativePointer
class IRange(val start: Int, val end: Int) {
override fun equals(o: Any?): Boolean {
......@@ -11,7 +8,7 @@ class IRange(val start: Int, val end: Int) {
val other = o
if (!other.canEqual(this as Any)) return false
if (start != other.start) return false
return if (end != other.end) false else true
return end == other.end
}
protected fun canEqual(other: Any?): Boolean {
......
......@@ -36,7 +36,7 @@ class IRect internal constructor(val left: Int, val top: Int, val right: Int, va
if (left != other.left) return false
if (top != other.top) return false
if (right != other.right) return false
return if (bottom != other.bottom) false else true
return bottom == other.bottom
}
protected fun canEqual(other: Any?): Boolean {
......@@ -54,7 +54,7 @@ class IRect internal constructor(val left: Int, val top: Int, val right: Int, va
}
override fun toString(): String {
return "IRect(_left=" + left + ", _top=" + top + ", _right=" + right + ", _bottom=" + bottom + ")"
return "IRect(_left=$left, _top=$top, _right=$right, _bottom=$bottom)"
}
companion object {
......
......@@ -21,7 +21,7 @@ class ISize internal constructor(val width: Int, val height: Int) {
val other = o
if (!other.canEqual(this as Any)) return false
if (width != other.width) return false
return if (height != other.height) false else true
return height == other.height
}
protected fun canEqual(other: Any?): Boolean {
......@@ -37,7 +37,7 @@ class ISize internal constructor(val width: Int, val height: Int) {
}
override fun toString(): String {
return "ISize(_width=" + width + ", _height=" + height + ")"
return "ISize(_width=$width, _height=$height)"
}
companion object {
......
package org.jetbrains.skia
enum class InversionMode {
NO, BRIGHTNESS, LIGHTNESS;
NO,
BRIGHTNESS,
LIGHTNESS;
}
\ No newline at end of file
......@@ -291,7 +291,7 @@ class Matrix33(vararg mat: Float) {
}
init {
require(mat.size == 9) { (if ("Expected 9 elements, got $mat" == null) null else mat.size)!! }
require(mat.size == 9) { "Expected 9 elements, got ${mat.size}" }
this.mat = mat
}
}
\ No newline at end of file
......@@ -65,7 +65,7 @@ class Matrix44(vararg mat: Float) {
* The constructor parameters are in row-major order.
*/
init {
require(mat.size == 16) { (if ("Expected 16 elements, got $mat" == null) null else mat.size)!! }
require(mat.size == 16) { "Expected 16 elements, got ${mat.size}" }
this.mat = mat
}
}
\ No newline at end of file
......@@ -23,7 +23,7 @@ class OutputWStream(out: OutputStream?) : WStream(_nMake(out), _FinalizerHolder.
private val _out: OutputStream?
internal object _FinalizerHolder {
private object _FinalizerHolder {
val PTR = _nGetFinalizer()
}
......
package org.jetbrains.skia
enum class PaintMode {
FILL, STROKE, STROKE_AND_FILL;
FILL,
STROKE,
STROKE_AND_FILL;
}
\ No newline at end of file
......@@ -17,9 +17,7 @@ class PathSegment constructor(
), Point(x0, y0), null, null, null, 0.0f, false, isClosedContour
) {
require(verbOrdinal == PathVerb.MOVE.ordinal || verbOrdinal == PathVerb.CLOSE.ordinal) {
"Expected MOVE or CLOSE, got " + PathVerb.values().get(
verbOrdinal
)
"Expected MOVE or CLOSE, got " + PathVerb.values()[verbOrdinal]
}
}
......
package org.jetbrains.skia
enum class PixelGeometry {
UNKNOWN, RGB_H, BGR_H, RGB_V, BGR_V;
UNKNOWN,
RGB_H,
BGR_H,
RGB_V,
BGR_V;
}
\ No newline at end of file
package org.jetbrains.skia
enum class SurfaceOrigin {
TOP_LEFT, BOTTOM_LEFT;
TOP_LEFT,
BOTTOM_LEFT;
}
\ No newline at end of file
......@@ -23,7 +23,7 @@ class SurfaceProps constructor(
if (isDeviceIndependentFonts != other.isDeviceIndependentFonts) return false
val `this$_pixelGeometry`: Any = pixelGeometry
val `other$_pixelGeometry`: Any = other.pixelGeometry
return if (if (`this$_pixelGeometry` == null) `other$_pixelGeometry` != null else `this$_pixelGeometry` != `other$_pixelGeometry`) false else true
return `this$_pixelGeometry` == `other$_pixelGeometry`
}
protected fun canEqual(other: Any?): Boolean {
......@@ -35,12 +35,12 @@ class SurfaceProps constructor(
var result = 1
result = result * PRIME + if (isDeviceIndependentFonts) 79 else 97
val `$_pixelGeometry`: Any = pixelGeometry
result = result * PRIME + (`$_pixelGeometry`?.hashCode() ?: 43)
result = result * PRIME + (`$_pixelGeometry`.hashCode())
return result
}
override fun toString(): String {
return "SurfaceProps(_deviceIndependentFonts=" + isDeviceIndependentFonts + ", _pixelGeometry=" + pixelGeometry + ")"
return "SurfaceProps(_deviceIndependentFonts=$isDeviceIndependentFonts, _pixelGeometry=$pixelGeometry)"
}
fun withDeviceIndependentFonts(_deviceIndependentFonts: Boolean): SurfaceProps {
......
package org.jetbrains.skia.paragraph
enum class Affinity {
UPSTREAM, DOWNSTREAM;
UPSTREAM,
DOWNSTREAM;
}
\ No newline at end of file
package org.jetbrains.skia.paragraph
enum class Alignment {
LEFT, RIGHT, CENTER, JUSTIFY, START, END;
LEFT,
RIGHT,
CENTER,
JUSTIFY,
START,
END;
}
\ No newline at end of file
package org.jetbrains.skia.paragraph
enum class BaselineMode {
ALPHABETIC, IDEOGRAPHIC;
ALPHABETIC,
IDEOGRAPHIC;
}
\ No newline at end of file
package org.jetbrains.skia.paragraph
enum class DecorationLineStyle {
SOLID, DOUBLE, DOTTED, DASHED, WAVY;
SOLID,
DOUBLE,
DOTTED,
DASHED,
WAVY;
}
\ No newline at end of file
package org.jetbrains.skia.paragraph
enum class Direction {
RTL, LTR;
RTL,
LTR;
}
\ No newline at end of file
package org.jetbrains.skia.paragraph
enum class HeightMode {
ALL, DISABLE_FIRST_ASCENT, DISABLE_LAST_DESCENT, DISABLE_ALL;
ALL,
DISABLE_FIRST_ASCENT,
DISABLE_LAST_DESCENT,
DISABLE_ALL;
}
\ No newline at end of file
......@@ -25,7 +25,7 @@ class PositionWithAffinity(val position: Int, affinity: Affinity) {
var result = 1
result = result * PRIME + position
val `$_affinity`: Any = affinity
result = result * PRIME + (`$_affinity`?.hashCode())
result = result * PRIME + `$_affinity`.hashCode()
return result
}
......
......@@ -23,7 +23,7 @@ class TextBox(val rect: Rect, direction: Direction) {
if (if (`this$_rect` == null) `other$_rect` != null else `this$_rect` != `other$_rect`) return false
val `this$_direction`: Any = direction
val `other$_direction`: Any = other.direction
return if (if (`this$_direction` == null) `other$_direction` != null else `this$_direction` != `other$_direction`) false else true
return !if (`this$_direction` == null) true else `this$_direction` != `other$_direction`
}
protected fun canEqual(other: Any?): Boolean {
......
package org.jetbrains.skia.paragraph
enum class TextStyleAttribute {
NONE, ALL_ATTRIBUTES, FONT, FOREGROUND, BACKGROUND, SHADOW, DECORATIONS, LETTER_SPACING, WORD_SPACING, FONT_EXACT;
NONE,
ALL_ATTRIBUTES,
FONT,
FOREGROUND,
BACKGROUND,
SHADOW,
DECORATIONS,
LETTER_SPACING,
WORD_SPACING,
FONT_EXACT;
}
\ No newline at end of file
package org.jetbrains.skia.shaper
class TrivialBidiRunIterator(text: String, level: Int) : MutableIterator<BidiRun?> {
internal val _length: Int
val _length: Int
internal val _level: Int
val _level: Int
internal var _atEnd: Boolean
override fun next(): BidiRun {
......
......@@ -3,9 +3,9 @@ package org.jetbrains.skia.shaper
import org.jetbrains.skia.*
class TrivialFontRunIterator(text: String, font: Font) : MutableIterator<FontRun?> {
internal val _length: Int
val _length: Int
internal val _font: Font
val _font: Font
internal var _atEnd: Boolean
override fun next(): FontRun {
......
package org.jetbrains.skia.shaper
class TrivialLanguageRunIterator(text: String, language: String) : MutableIterator<LanguageRun?> {
internal val _length: Int
val _length: Int
internal val _language: String
val _language: String
internal var _atEnd: Boolean
override fun next(): LanguageRun {
......
package org.jetbrains.skia.shaper
class TrivialScriptRunIterator(text: String, script: String) : MutableIterator<ScriptRun?> {
internal val _length: Int
val _length: Int
internal val _script: String
val _script: String
internal var _atEnd: Boolean
override fun next(): ScriptRun {
......
......@@ -46,7 +46,7 @@ class AnimationBuilder internal constructor(ptr: NativePointer) : Managed(ptr, _
}
}
internal object _FinalizerHolder {
private object _FinalizerHolder {
val PTR = _nGetFinalizer()
}
......
package org.jetbrains.skia.skottie
enum class AnimationBuilderFlag(internal val _flag: Int) {
enum class AnimationBuilderFlag(val _flag: Int) {
/**
* Normally, all static image frames are resolved at
* load time via ImageAsset::getFrame(0). With this flag,
......
package org.jetbrains.skia.skottie
enum class LogLevel {
WARNING, ERROR;
WARNING,
ERROR;
}
\ No newline at end of file
package org.jetbrains.skia.skottie
enum class RenderFlag(internal val _flag: Int) {
enum class RenderFlag(val _flag: Int) {
/**
* When rendering into a known transparent buffer, clients can pass
* this flag to avoid some unnecessary compositing overhead for
......
package org.jetbrains.skia.svg
class SVGLength(val value: Float, unit: SVGLengthUnit) {
internal val _unit: SVGLengthUnit
class SVGLength(val value: Float, val unit: SVGLengthUnit) {
internal constructor(value: Float, unit: Int) : this(value, SVGLengthUnit.values()[unit])
constructor(value: Float) : this(value, SVGLengthUnit.NUMBER) {}
val unit: SVGLengthUnit
get() = _unit
override fun equals(o: Any?): Boolean {
if (o === this) return true
if (o !is SVGLength) return false
......@@ -40,14 +35,10 @@ class SVGLength(val value: Float, unit: SVGLengthUnit) {
}
fun withValue(_value: Float): SVGLength {
return if (value == _value) this else SVGLength(_value, _unit)
return if (value == _value) this else SVGLength(_value, unit)
}
fun withUnit(_unit: SVGLengthUnit): SVGLength {
return if (this._unit === _unit) this else SVGLength(value, _unit)
}
init {
_unit = unit
return if (this.unit === unit) this else SVGLength(value, unit)
}
}
\ No newline at end of file
......@@ -5,15 +5,15 @@ import kotlin.math.hypot
import kotlin.math.sqrt
class SVGLengthContext constructor(
internal val width: Float,
internal val height: Float,
internal val dpi: Float = 90f
val width: Float,
val height: Float,
val dpi: Float = 90f
) {
constructor(size: Point) : this(size.x, size.y, 90f)
fun resolve(length: SVGLength, type: SVGLengthType): Float {
return when (length._unit) {
return when (length.unit) {
SVGLengthUnit.NUMBER -> length.value
SVGLengthUnit.PX -> length.value
SVGLengthUnit.PERCENTAGE -> {
......@@ -32,7 +32,7 @@ class SVGLengthContext constructor(
SVGLengthUnit.IN -> length.value * dpi
SVGLengthUnit.PT -> length.value * dpi / 72.272f
SVGLengthUnit.PC -> length.value * dpi * 12.0f / 72.272f
else -> throw IllegalArgumentException("Unknown SVGLengthUnit: " + length._unit)
else -> throw IllegalArgumentException("Unknown SVGLengthUnit: " + length.unit)
}
}
......
package org.jetbrains.skia.svg
enum class SVGLengthType {
HORIZONTAL, VERTICAL, OTHER;
HORIZONTAL,
VERTICAL,
OTHER;
}
\ No newline at end of file
package org.jetbrains.skia.svg
enum class SVGLengthUnit {
UNKNOWN, NUMBER, PERCENTAGE, EMS, EXS, PX, CM, MM, IN, PT, PC;
UNKNOWN,
NUMBER,
PERCENTAGE,
EMS,
EXS,
PX,
CM,
MM,
IN,
PT,
PC;
}
\ No newline at end of file
package org.jetbrains.skia.svg
enum class SVGPreserveAspectRatioScale {
MEET, SLICE;
MEET,
SLICE;
}
\ No newline at end of file
......@@ -70,7 +70,7 @@ class SVGSVG internal constructor(ptr: NativePointer) : SVGContainer(ptr) {
fun setX(length: SVGLength): SVGSVG {
return try {
Stats.onNativeCall()
_nSetX(_ptr, length.value, length._unit.ordinal)
_nSetX(_ptr, length.value, length.unit.ordinal)
this
} finally {
reachabilityBarrier(this)
......@@ -91,7 +91,7 @@ class SVGSVG internal constructor(ptr: NativePointer) : SVGContainer(ptr) {
fun setY(length: SVGLength): SVGSVG {
return try {
Stats.onNativeCall()
_nSetY(_ptr, length.value, length._unit.ordinal)
_nSetY(_ptr, length.value, length.unit.ordinal)
this
} finally {
reachabilityBarrier(this)
......@@ -112,7 +112,7 @@ class SVGSVG internal constructor(ptr: NativePointer) : SVGContainer(ptr) {
fun setWidth(length: SVGLength): SVGSVG {
return try {
Stats.onNativeCall()
_nSetWidth(_ptr, length.value, length._unit.ordinal)
_nSetWidth(_ptr, length.value, length.unit.ordinal)
this
} finally {
reachabilityBarrier(this)
......@@ -133,7 +133,7 @@ class SVGSVG internal constructor(ptr: NativePointer) : SVGContainer(ptr) {
fun setHeight(length: SVGLength): SVGSVG {
return try {
Stats.onNativeCall()
_nSetHeight(_ptr, length.value, length._unit.ordinal)
_nSetHeight(_ptr, length.value, length.unit.ordinal)
this
} finally {
reachabilityBarrier(this)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment