mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 14:21:16 +00:00
Fix compilation of @linear-gradient with brush properties in C++
This commit is contained in:
parent
3854d1236a
commit
1d54947de9
2 changed files with 17 additions and 1 deletions
|
@ -1661,7 +1661,7 @@ fn compile_expression(
|
||||||
format!("sixtyfps::GradientStop{{ {}, {}, }}", color, position)
|
format!("sixtyfps::GradientStop{{ {}, {}, }}", color, position)
|
||||||
});
|
});
|
||||||
format!(
|
format!(
|
||||||
"[&] {{ const sixtyfps::GradientStop stops[] = {{ {} }}; return sixtyfps::LinearGradientBrush({}, stops, {}); }}()",
|
"[&] {{ const sixtyfps::GradientStop stops[] = {{ {} }}; return sixtyfps::Brush(sixtyfps::LinearGradientBrush({}, stops, {})); }}()",
|
||||||
stops_it.join(", "), angle, stops.len()
|
stops_it.join(", "), angle, stops.len()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
16
tests/cases/types/gradients.60
Normal file
16
tests/cases/types/gradients.60
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
/* LICENSE BEGIN
|
||||||
|
This file is part of the SixtyFPS Project -- https://sixtyfps.io
|
||||||
|
Copyright (c) 2020 Olivier Goffart <olivier.goffart@sixtyfps.io>
|
||||||
|
Copyright (c) 2020 Simon Hausmann <simon.hausmann@sixtyfps.io>
|
||||||
|
|
||||||
|
SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
This file is also available under commercial licensing terms.
|
||||||
|
Please contact info@sixtyfps.io for more information.
|
||||||
|
LICENSE END */
|
||||||
|
|
||||||
|
// Verify that this compiles with all generators
|
||||||
|
|
||||||
|
Test := Rectangle {
|
||||||
|
background: @linear-gradient(45deg, #ff9a9e 0%, #fad0c4 99%, #fad0c4 100%);
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue