Skip to content

Instantly share code, notes, and snippets.

View Peanuuutz's full-sized avatar
💭
Studying

Peanuuutz Peanuuutz

💭
Studying
View GitHub Profile
@Peanuuutz
Peanuuutz / GridScope.kt
Created April 7, 2023 14:22
Non-lazy Grid (Primitive)
package net.peanuuutz.compose.desktop
import androidx.compose.runtime.Immutable
import androidx.compose.ui.Modifier
@Immutable
interface GridScope {
fun Modifier.span(
span: GridSpanScope.() -> Int
): Modifier
@Peanuuutz
Peanuuutz / CachedDrawModifierNode.kt
Last active April 7, 2023 02:44
Modifier.Node Version of Modifier.drawWithCache
@file:OptIn(ExperimentalComposeUiApi::class)
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
package net.peanuuutz.compose.desktop
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.BuildDrawCacheParams
import androidx.compose.ui.draw.CacheDrawScope
import androidx.compose.ui.draw.DrawResult
@Peanuuutz
Peanuuutz / BorderWithEffect.kt
Created April 6, 2023 14:55
Compose Border with Effect
@file:OptIn(ExperimentalComposeUiApi::class)
package net.peanuuutz.compose.desktop
import androidx.compose.runtime.Stable
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.Brush