commonMain.jetbrains.datalore.vis.svg.SvgGElement.kt Maven / Gradle / Ivy
/*
* Copyright (c) 2019. JetBrains s.r.o.
* Use of this source code is governed by the MIT license that can be found in the LICENSE file.
*/
package jetbrains.datalore.vis.svg
import jetbrains.datalore.base.geometry.DoubleRectangle
import jetbrains.datalore.base.geometry.DoubleVector
import jetbrains.datalore.base.observable.property.Property
import jetbrains.datalore.vis.svg.SvgTransformable.Companion.TRANSFORM
class SvgGElement : SvgGraphicsElement(), SvgTransformable,
SvgContainer {
override val elementName = "g"
override val bBox: DoubleRectangle
get() = container().getPeer()!!.getBBox(this)
override fun transform(): Property {
return getAttribute(TRANSFORM)
}
override fun pointToTransformedCoordinates(point: DoubleVector): DoubleVector {
return container().getPeer()!!.invertTransform(this, point)
}
override fun pointToAbsoluteCoordinates(point: DoubleVector): DoubleVector {
return container().getPeer()!!.applyTransform(this, point)
}
}