[orx-poisson-fill] Add content scale support

This commit is contained in:
Edwin Jakobs
2022-11-30 21:34:28 +01:00
parent aa708ee091
commit 947f6476a7
2 changed files with 29 additions and 4 deletions

View File

@@ -42,18 +42,16 @@ class PoissonFiller(val width: Int, val height: Int, type: ColorType = ColorType
class PoissonFill : Filter() {
private var filler: PoissonFiller? = null
override fun apply(source: Array<ColorBuffer>, target: Array<ColorBuffer>) {
if (target.isNotEmpty()) {
filler?.let {
if (it.width != target[0].width || it.height != target[0].height) {
if (it.width != target[0].effectiveWidth || it.height != target[0].effectiveHeight) {
it.destroy()
filler = null
}
}
if (filler == null) {
filler = PoissonFiller(target[0].width, target[0].height)
filler = PoissonFiller(target[0].effectiveWidth, target[0].effectiveHeight)
}
filler?.let {