All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jetbrains.kotlinx.ggdsl.dsl.freeScales.kt Maven / Gradle / Ivy

There is a newer version: 0.4.0-dev-15
Show newest version
/*
* Copyright 2020-2022 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/

package org.jetbrains.kotlinx.ggdsl.dsl

import org.jetbrains.kotlinx.ggdsl.ir.scale.FreePositionalScale
import org.jetbrains.kotlinx.ggdsl.ir.scale.PositionalScale
import org.jetbrains.kotlinx.ggdsl.ir.scale.PositionalUnspecifiedScale
import kotlin.reflect.typeOf

/**
 * TODO: will be redesigned in the near future.
 * Applies given [PositionalScale] for this aes (as [FreePositionalScale]).
 *
 * @param scale positional scale.
 * @return [FreePositionalScale]
 */
public inline operator fun  ScalablePositionalAes.invoke(
    scale: PositionalScale
): FreePositionalScale {
    val freeScale = FreePositionalScale(
        this.name,
        scale,
        typeOf()
    )
    context.bindingCollector.freeScales[this.name] = freeScale
    return freeScale
}

/**
 * TODO: will be redesigned in the near future.
 * Applies given [PositionalUnspecifiedScale] for this aes (as [FreePositionalScale]).
 *
 * @param scale positional unspecified scale.
 * @return [FreePositionalScale]
 */
public inline operator fun  ScalablePositionalAes.invoke(
    scale: PositionalUnspecifiedScale
): FreePositionalScale {
    val freeScale = FreePositionalScale(
        this.name,
        scale,
        typeOf()
    )
    context.bindingCollector.freeScales[this.name] = freeScale
    return freeScale
}






© 2015 - 2025 Weber Informatics LLC | Privacy Policy