use pixels in setBackgroundImagePosition and add argument for clamp
This commit is contained in:
@@ -19,7 +19,7 @@ abstract class FilamentController {
|
||||
|
||||
Future resize(int width, int height, { double devicePixelRatio = 1, double contentScaleFactor=1});
|
||||
Future setBackgroundImage(String path);
|
||||
Future setBackgroundImagePosition(double x, double y);
|
||||
Future setBackgroundImagePosition(double x, double y, {bool clamp=false});
|
||||
Future loadSkybox(String skyboxPath);
|
||||
Future removeSkybox();
|
||||
Future loadIbl(String path);
|
||||
@@ -137,8 +137,8 @@ class PolyvoxFilamentController extends FilamentController {
|
||||
}
|
||||
|
||||
@override
|
||||
Future setBackgroundImagePosition(double x, double y) async {
|
||||
await _channel.invokeMethod("setBackgroundImagePosition", [x,y]);
|
||||
Future setBackgroundImagePosition(double x, double y, { bool clamp = false}) async {
|
||||
await _channel.invokeMethod("setBackgroundImagePosition", [x,y, clamp]);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -63,10 +63,10 @@ class _FilamentWidgetState extends State<FilamentWidget> {
|
||||
}
|
||||
WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
|
||||
var size = ((context.findRenderObject()) as RenderBox).size;
|
||||
print("Requesting texture creation for Filament of size $size");
|
||||
print("Requesting creation of Filament back-end texture/viewer for viewport size $size");
|
||||
await widget.controller
|
||||
.createTextureViewer(size.width.toInt(), size.height.toInt());
|
||||
print("Filament texture available");
|
||||
print("Filament texture/viewer created.");
|
||||
setState(() {
|
||||
_ready = true;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user