mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-11-29 07:34:13 +01:00
fix(mornye): remove the thin line where a full screen cover ends
Under the title of the Mornye player with a full screen still cover, a line about four device pixels tall ran across the page at the cover's lower edge, lighter or darker than the one colour below it depending on the cover. The cover's glow is drawn once at a quarter of the physical resolution. The box of its soft copy ended on a fraction of a pixel there, so the last row was covered only in part: the mask that fades the soft copy out reached that row with the same partial coverage and left part of the blurred cover in it. Stretched back to the page, that row is the line. The box now ends on a whole pixel.
This commit is contained in:
1 parent
50b8d09955
commit
758d7c7744
2 files changed
+26
-2
No files matched your search
@@ -284,11 +284,13 @@ class _MornyeCoverGlowState extends State<MornyeCoverGlow>
|
||||
width.toDouble(),
|
||||
artworkHeight * scale,
|
||||
);
|
||||
// Whole pixels: a last row the box covered in part would keep part of
|
||||
// the soft copy under the mask and show as a line at the cover's edge.
|
||||
final soft = Rect.fromLTWH(
|
||||
0,
|
||||
0,
|
||||
width.toDouble(),
|
||||
(artworkHeight - fadeTop) * scale,
|
||||
math.max(1, ((artworkHeight - fadeTop) * scale).roundToDouble()),
|
||||
);
|
||||
// Starts under the part of the soft copy that hides the cover, so its
|
||||
// upper edge is never seen.
|
||||
|
||||
@@ -65,6 +65,7 @@ void main() {
|
||||
required String? artUri,
|
||||
bool visible = true,
|
||||
bool reducedMotion = false,
|
||||
double fadeStart = 0.72,
|
||||
}) async {
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
@@ -76,7 +77,7 @@ void main() {
|
||||
child: MornyeCoverGlow(
|
||||
artUri: artUri,
|
||||
visible: visible,
|
||||
fadeStart: 0.72,
|
||||
fadeStart: fadeStart,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -164,6 +165,27 @@ void main() {
|
||||
expect(dimmed, greaterThan(mornyeLabelBackgroundLuminance - 0.03));
|
||||
});
|
||||
|
||||
testWidgets('no line is left where the soft copy ends', (tester) async {
|
||||
final white = await _cover(tester, directory, const Color(0xffffffff));
|
||||
// The fade is 114 dp, 28.5 pixels of the drawn image: its last row is
|
||||
// covered in half.
|
||||
await pumpGlow(tester, artUri: white, fadeStart: 0.715);
|
||||
|
||||
final drawn = await pixels(tester);
|
||||
final colour = pixel(drawn, 50, drawn.$1.height - 1);
|
||||
// The soft copy is all but gone in its last row, and gone after it.
|
||||
for (var y = 28; y < 32; y++) {
|
||||
final row = pixel(drawn, 50, y);
|
||||
for (var channel = 0; channel < 3; channel++) {
|
||||
expect(
|
||||
row[channel],
|
||||
closeTo(colour[channel], y == 28 ? 3 : 1),
|
||||
reason: 'row $y',
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
test('the one colour is the lower edge as the page shows it', () {
|
||||
// White above. The lower 30%: green at both sides, red then blue in
|
||||
// the middle.
|
||||
|
||||
Reference in new issue
Block a user