add clamp option to android bindings and allow resource paths starting with file://

This commit is contained in:
Nick Fisher
2022-09-09 13:00:19 +10:00
parent 7f2c68b199
commit 01e1efabc1
2 changed files with 6 additions and 2 deletions

View File

@@ -156,6 +156,10 @@ class PolyvoxFilamentPlugin: FlutterPlugin, MethodCallHandler, ActivityAware {
}
fun getAssetPath(path:String) : String {
if(path.startsWith("file://")) {
return path
}
val loader = FlutterInjector.instance().flutterLoader()
val key = loader.getLookupKeyForAsset(path)
val hotReloadPath = HotReloadPathHelper.getAssetPath(key, activity.getPackageName())
@@ -240,7 +244,7 @@ class PolyvoxFilamentPlugin: FlutterPlugin, MethodCallHandler, ActivityAware {
"setBackgroundImagePosition" -> {
executor.execute {
val args = call.arguments as ArrayList<Any?>
_lib.set_background_image_position(_viewer!!, (args[0] as Double).toFloat(), (args[1] as Double).toFloat())
_lib.set_background_image_position(_viewer!!, (args[0] as Double).toFloat(), (args[1] as Double).toFloat(), (args[2] as Boolean))
result.success("OK");
}
}