update
This commit is contained in:
@@ -114,6 +114,25 @@ constexpr int kProjectTreeDockStartupHeight = 170;
|
||||
constexpr int kPropertiesDockStartupHeight = 380;
|
||||
constexpr char kMimeHotspotAnimationJson[] = "application/x-hfut-hotspot-animation+json";
|
||||
|
||||
void applyVisibleBlackholesToBackground(QImage& bgPremul, const QVector<core::Project::Entity>& entities) {
|
||||
for (const auto& ex : entities) {
|
||||
if (ex.blackholeVisible && ex.cutoutPolygonWorld.size() >= 3) {
|
||||
entity_cutout::applyBlackFillToBackground(bgPremul, ex.cutoutPolygonWorld);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[[nodiscard]] QVector<QVector<QPointF>> visibleBlackholePolygonsFromEntities(
|
||||
const QVector<core::Project::Entity>& entities) {
|
||||
QVector<QVector<QPointF>> holes;
|
||||
for (const auto& ex : entities) {
|
||||
if (ex.blackholeVisible && ex.cutoutPolygonWorld.size() >= 3) {
|
||||
holes.push_back(ex.cutoutPolygonWorld);
|
||||
}
|
||||
}
|
||||
return holes;
|
||||
}
|
||||
|
||||
[[nodiscard]] QString firstAnimationSchemeIdNonNoneWs(const core::Project& proj) {
|
||||
for (const auto& a : proj.animations()) {
|
||||
if (a.id != QStringLiteral("none"))
|
||||
@@ -3901,6 +3920,7 @@ void MainWindow::rebuildCentralPages() {
|
||||
if (!bg.isNull() && bg.format() != QImage::Format_ARGB32_Premultiplied) {
|
||||
bg = bg.convertToFormat(QImage::Format_ARGB32_Premultiplied);
|
||||
}
|
||||
applyVisibleBlackholesToBackground(bg, m_workspace.entities());
|
||||
QImage cutout;
|
||||
if (!bg.isNull()) {
|
||||
QPointF topLeft;
|
||||
@@ -4028,6 +4048,8 @@ void MainWindow::rebuildCentralPages() {
|
||||
if (bgRegion.format() != QImage::Format_ARGB32_Premultiplied) {
|
||||
bgRegion = bgRegion.convertToFormat(QImage::Format_ARGB32_Premultiplied);
|
||||
}
|
||||
entity_cutout::applyBlackHolesToImageRegion(
|
||||
bgRegion, region, visibleBlackholePolygonsFromEntities(m_workspace.entities()));
|
||||
QVector<QPointF> localPoly;
|
||||
localPoly.reserve(ent.cutoutPolygonWorld.size());
|
||||
for (const auto& p : ent.cutoutPolygonWorld) {
|
||||
|
||||
Reference in New Issue
Block a user