File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
app/src/main/kotlin/li/songe/gkd/data Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -621,14 +621,16 @@ data class RawSubscription(
621621 return null
622622 }
623623
624- private val expVars = arrayOf(
624+ private val preFillExpVars = arrayOf(
625625 " left" ,
626626 " top" ,
627627 " right" ,
628628 " bottom" ,
629629 " width" ,
630630 " height" ,
631- " random"
631+ " random" ,
632+ " screenWidth" ,
633+ " screenHeight" ,
632634 )
633635
634636 private fun setVariables (exp : Expression ? , rect : Rect ) {
@@ -647,8 +649,8 @@ data class RawSubscription(
647649 private fun getExpression (value : String? ): Expression ? {
648650 return if (value != null ) {
649651 try {
650- ExpressionBuilder (value).variables(* expVars ).build().apply {
651- expVars .forEach { v ->
652+ ExpressionBuilder (value).variables(* preFillExpVars ).build().apply {
653+ preFillExpVars .forEach { v ->
652654 // 预填充作 validate
653655 setVariable(v, 0.0 )
654656 }
You can’t perform that action at this time.
0 commit comments