-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listd: api docsIssues with https://api.flutter.dev/Issues with https://api.flutter.dev/d: examplesSample code and demosSample code and demosframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
Description
When I was reading through Align's documentation I found the following explanation.
The 0.2 is the xAlign and the 0.6 is the YAlign, follow the formulas in the official documentation and finally calculate a point (36.0,48.0). When xAlign is less than zero or yAlign is less than zero, the calculation according to this formula is always positive. And the formula for calculating the offset of FlutterLogo and Container in the source code is as follows(alignment.dart lines:290):
Offset other = size - child!.size as Offset;
final double centerX = other.dx / 2.0;
final double centerY = other.dy / 2.0;
childParentData.offset = Offset(centerX + xAlign * centerX, centerY + yAlign * centerY);
The result according to the formula in the source code does not seem to have any relation to (36,48). Did I misunderstand or did the document say something wrong?
gnprice
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listd: api docsIssues with https://api.flutter.dev/Issues with https://api.flutter.dev/d: examplesSample code and demosSample code and demosframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
