Fix CounterLayerArgs devicePixelRatio order
This commit is contained in:
parent
8dee2a1c8b
commit
590be6d6e7
|
@ -250,9 +250,9 @@ QImage GenerateCounterLayer(CounterLayerArgs &&args) {
|
||||||
}();
|
}();
|
||||||
|
|
||||||
auto result = QImage(
|
auto result = QImage(
|
||||||
QSize(d.size, d.size) * d.devicePixelRatio,
|
QSize(d.size, d.size) * args.devicePixelRatio,
|
||||||
QImage::Format_ARGB32);
|
QImage::Format_ARGB32);
|
||||||
result.setDevicePixelRatio(d.devicePixelRatio);
|
result.setDevicePixelRatio(args.devicePixelRatio);
|
||||||
result.fill(Qt::transparent);
|
result.fill(Qt::transparent);
|
||||||
|
|
||||||
auto p = QPainter(&result);
|
auto p = QPainter(&result);
|
||||||
|
|
|
@ -48,10 +48,10 @@ struct CounterLayerArgs {
|
||||||
using required = base::required<T>;
|
using required = base::required<T>;
|
||||||
|
|
||||||
required<int> size = 16;
|
required<int> size = 16;
|
||||||
|
double devicePixelRatio = 1.;
|
||||||
required<int> count = 1;
|
required<int> count = 1;
|
||||||
required<style::color> bg;
|
required<style::color> bg;
|
||||||
required<style::color> fg;
|
required<style::color> fg;
|
||||||
double devicePixelRatio = 1.;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
[[nodiscard]] QImage GenerateCounterLayer(CounterLayerArgs &&args);
|
[[nodiscard]] QImage GenerateCounterLayer(CounterLayerArgs &&args);
|
||||||
|
|
Loading…
Reference in New Issue