WT 1.1.14 tutorial positions fix, uxcam settings

This commit is contained in:
bossanyit
2021-05-06 22:44:55 +02:00
parent 3137bc2330
commit cd0687a529
10 changed files with 77 additions and 115 deletions
+13 -14
View File
@@ -24,43 +24,42 @@ class TutorialWidget with Trans, Logging {
void tip(BuildContext context) {
setContext(context);
if (tooltip != null && tooltip!.isOpen) {
tooltip!.rebuild();
}
var renderBox = context.findRenderObject() as RenderBox;
final overlay = Overlay.of(context)!.context.findRenderObject() as RenderBox?;
var targetGlobalCenter = renderBox.localToGlobal(renderBox.size.center(Offset.zero), ancestor: overlay);
final TutorialBloc bloc = BlocProvider.of<TutorialBloc>(context);
if (tooltip != null && tooltip!.isOpen) {
tooltip!.rebuild();
}
final double mediaSize = MediaQuery.of(context).size.width;
final double mediaHeight = MediaQuery.of(context).size.height;
Rect? area;
if (bloc.action != null) {
area = bloc.action!.showBubble == true
? Rect.fromLTWH(targetGlobalCenter.dx - bloc.action!.bubbleX, targetGlobalCenter.dy - bloc.action!.bubbleY,
bloc.action!.bubbleWidth.toDouble(), bloc.action!.bubbleHeight.toDouble())
? Rect.fromLTWH(mediaSize / 2 - 220, targetGlobalCenter.dy - bloc.action!.bubbleY, bloc.action!.bubbleWidth.toDouble(),
bloc.action!.bubbleHeight.toDouble())
//? Rect.fromLTWH(targetGlobalCenter.dx - 60, targetGlobalCenter.dy + 120, 420, 320)
: null;
}
final double mediaSize = MediaQuery.of(context).size.width;
final double mediaHeight = MediaQuery.of(context).size.width;
final double distortion = mediaHeight / bloc.mediaHeightBase;
double fontSize = 14;
if (mediaSize > 400) {
fontSize = 15;
} else if (mediaSize < 375) {
if (mediaSize > 800) {
fontSize = 16;
} else if (mediaSize < 600) {
fontSize = 13;
}
double calculatedTop = bloc.top! / distortion;
//-((1 - distortion) * 100 * (fontSize));
double calculatedTop = bloc.top != null ? bloc.top! : 20.0;
if (calculatedTop < 0) {
calculatedTop = 10;
}
print("Height: $mediaHeight, distortion: $distortion top: ${bloc.top!} calculated $calculatedTop");
print("Height: $mediaHeight, width: $mediaSize distortion: $distortion top: ${bloc.top!} calculated $calculatedTop");
print("targetCenter X ${targetGlobalCenter.dx}");
tooltip = SuperTooltip(
top: calculatedTop,