Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BoxDecorations don't fully cover content #32757

Closed
enyo opened this issue May 15, 2019 · 7 comments
Closed

BoxDecorations don't fully cover content #32757

enyo opened this issue May 15, 2019 · 7 comments
Labels
engine flutter/engine repository. See also e: labels. framework flutter/packages/flutter repository. See also f: labels.

Comments

@enyo
Copy link

enyo commented May 15, 2019

Steps to Reproduce

  1. Create a widget that has a height that is not an integer
  2. Put a stack in there with two widgets, both covering the full area: one that acts as a background with a solid color, and the other one is the foreground and contains a DecoratedBox
  3. If the foreground widget is a DecoratedBox (without a child), it does not fully cover the background image if the height of the widget is not a full integer.

If the foreground widget is simply a container with a solid color, it works as expected.

Here is a sample code:

import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) => MaterialApp(home: MyHomePage());
}

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) => Column(
        children: [
          SizedBox(
            height: 200.2,
            child: Stack(
              fit: StackFit.expand,
              children: [
                // The background widget that is visible as a thin line.
                Container(color: Colors.white),
                // The foreground widget that should cover the whole area.
                DecoratedBox(decoration: BoxDecoration(color: Colors.black)),
              ],
            ),
          ),
        ],
      );
}

IMG_13C0317C3667-1

$ flutter doctor -v
[✓] Flutter (Channel beta, v1.5.4-hotfix.2, on Mac OS X 10.14.5 18F96h, locale en-AT)
    • Flutter version 1.5.4-hotfix.2 at /Users/enyo/local/flutter
    • Framework revision 7a4c33425d (2 weeks ago), 2019-04-29 11:05:24 -0700
    • Engine revision 52c7a1e849
    • Dart version 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)


[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/enyo/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
    • All Android licenses accepted.

[!] iOS toolchain - develop for iOS devices (Xcode 10.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.2.1, Build version 10E1001
    ✗ Verify that all connected devices have been paired with this computer in Xcode.
      If all devices have been paired, libimobiledevice and ideviceinstaller may require updating.
      To update with Brew, run:
        brew update
        brew uninstall --ignore-dependencies libimobiledevice
        brew uninstall --ignore-dependencies usbmuxd
        brew install --HEAD usbmuxd
        brew unlink usbmuxd
        brew link usbmuxd
        brew install --HEAD libimobiledevice
        brew install ideviceinstaller
    • ios-deploy 2.0.0
    ✗ ios-deploy out of date (1.9.4 is required). To upgrade with Brew:
        brew upgrade ios-deploy
    • CocoaPods version 1.6.0.beta.2

[✓] Android Studio (version 3.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 29.0.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] VS Code (version 1.33.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.0.0

[✓] Connected device (1 available)
    • Destroyer • 60ca238f17cb69a3d45f4708dc55c47e4e8b532e • ios • iOS 12.2

! Doctor found issues in 1 category.
@enyo enyo changed the title Gradients don't fully cover content BoxDecorations don't fully cover content May 15, 2019
@HansMuller
Copy link
Contributor

This looks a bit like a known problem with antialiasing and mapping from logical pixels to device pixels. There's an open issue for a documentation fix: #14288

More info about the problem can be found here:
#14288 (comment)
#17084 (comment)
#15035 (comment)

@enyo
Copy link
Author

enyo commented May 16, 2019

That does look very similar yes. What is interesting though, is that changing my code so the foreground container has a color instead of a decoration works. So there does seem to be a difference between the rendering of the two.

@BondarenkoStas BondarenkoStas added engine flutter/engine repository. See also e: labels. framework flutter/packages/flutter repository. See also f: labels. labels Oct 10, 2019
@darshankawar
Copy link
Member

Hi @enyo,
Is this still a valid issue ? Although I tried to replicate it on latest stable (1.20.3) using your code sample, I see below:

32757

Also, per your above comment, it sounds to be similar to 14288. Can this issue be tracked in 14288 ?

Thanks.

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Sep 9, 2020
@enyo
Copy link
Author

enyo commented Sep 9, 2020

I'll try to see if the problem still exists in the latest flutter version next week.

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Sep 9, 2020
@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Sep 10, 2020
@markusaksli-nc
Copy link
Member

Without additional information, we are unfortunately not sure how to resolve this issue.
We are therefore reluctantly going to close this bug for now.
Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away!
Thanks for your contribution.

@markusaksli-nc markusaksli-nc removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Oct 7, 2020
@enyo
Copy link
Author

enyo commented Oct 7, 2020

The screenshot here actually still shows the issue clearly (the white line, which shouldn't appear).

But it's correct that this can be tracked by #14288 . That seems to be the same issue.

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
engine flutter/engine repository. See also e: labels. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

No branches or pull requests

5 participants