Skip to content

Commit

Permalink
Merge pull request #35 from Kavantix/bugfix/maxpaint-smaller
Browse files Browse the repository at this point in the history
Fixed issue where maxPaintExtent was incorrect
  • Loading branch information
Kavantix committed Jun 11, 2021
2 parents bc82bd9 + 5bd870d commit 6a52964
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.2.5

Fixed issue where the `maxPaintExtent` was not calculated correctly in some rare cases.

# 0.2.4

Fixed formatting for pub analysis.
Expand Down
2 changes: 1 addition & 1 deletion lib/src/rendering/multi_sliver.dart
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ class RenderMultiSliver extends RenderSliver
maxPaintOffset);
maxPaintExtent = max(
maxPaintExtent,
layoutOffset +
effectiveLayoutOffset +
childParentData.geometry.maxPaintExtent +
constraints.scrollOffset -
childParentData.constraints.scrollOffset,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: sliver_tools
description: A set of useful sliver tools that are missing from the flutter framework
version: 0.2.4
version: 0.2.5
homepage: https://github.com/Kavantix
repository: https://github.com/Kavantix/sliver_tools
issue_tracker: https://github.com/Kavantix/sliver_tools/issues
Expand Down
9 changes: 4 additions & 5 deletions test/multi_sliver_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ void main() => multiSliverTests();
Widget box(Key? key, String title, {required double height}) {
return Container(
key: key,
color: const Color(0xFF000000),
alignment: Alignment.center,
height: height,
width: double.infinity,
Expand Down Expand Up @@ -322,10 +323,10 @@ void multiSliverTests() {
[
const SizedBox(height: 100),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () => taps++,
child: const SizedBox(
child: Container(
key: boxKey,
color: const Color(0xFF000000),
height: 1,
),
),
Expand Down Expand Up @@ -361,7 +362,6 @@ void multiSliverTests() {
children: [
const SliverToBoxAdapter(child: SizedBox(height: 400)),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () => taps++,
child: box(boxKey, 'Title', height: 1),
),
Expand Down Expand Up @@ -390,7 +390,6 @@ void multiSliverTests() {
MultiSliver(
children: [
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () => taps++,
child: box(UniqueKey(), 'Title', height: 200),
),
Expand All @@ -407,7 +406,7 @@ void multiSliverTests() {
));
expect(taps, 0);
final thebox = find.byKey(boxKey);
await tester.tap(thebox);
await tester.tap(thebox, warnIfMissed: false);
expect(taps, 0);
});

Expand Down
2 changes: 1 addition & 1 deletion test/sliver_stack_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ void sliverStackTests() {
Widget box(Key? key, {double? size}) {
return Container(
key: key,
color: const Color(0xFF000000),
height: size,
width: size,
);
Expand Down Expand Up @@ -329,7 +330,6 @@ void sliverStackTests() {
right: right,
bottom: bottom,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () => tapped++,
child: child,
),
Expand Down

0 comments on commit 6a52964

Please sign in to comment.