mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-05-05 13:52:43 +08:00
Restore dbox
behavior from ftxui5.0.0
Some checks failed
Build / Bazel, ${{ matrix.compiler }}, ${{ matrix.os }} (cl, windows-latest) (push) Has been cancelled
Build / Bazel, ${{ matrix.compiler }}, ${{ matrix.os }} (gcc, macos-latest) (push) Has been cancelled
Build / Bazel, ${{ matrix.compiler }}, ${{ matrix.os }} (gcc, ubuntu-latest) (push) Has been cancelled
Build / Bazel, ${{ matrix.compiler }}, ${{ matrix.os }} (llvm, macos-latest) (push) Has been cancelled
Build / Bazel, ${{ matrix.compiler }}, ${{ matrix.os }} (llvm, ubuntu-latest) (push) Has been cancelled
Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (cl, Windows MSVC, windows-latest) (push) Has been cancelled
Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (gcc, Linux GCC, ubuntu-latest) (push) Has been cancelled
Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (llvm, llvm-cov gcov, Linux Clang, ubuntu-latest) (push) Has been cancelled
Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (llvm, llvm-cov gcov, MacOS clang, macos-latest) (push) Has been cancelled
Documentation / documentation (push) Has been cancelled
Some checks failed
Build / Bazel, ${{ matrix.compiler }}, ${{ matrix.os }} (cl, windows-latest) (push) Has been cancelled
Build / Bazel, ${{ matrix.compiler }}, ${{ matrix.os }} (gcc, macos-latest) (push) Has been cancelled
Build / Bazel, ${{ matrix.compiler }}, ${{ matrix.os }} (gcc, ubuntu-latest) (push) Has been cancelled
Build / Bazel, ${{ matrix.compiler }}, ${{ matrix.os }} (llvm, macos-latest) (push) Has been cancelled
Build / Bazel, ${{ matrix.compiler }}, ${{ matrix.os }} (llvm, ubuntu-latest) (push) Has been cancelled
Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (cl, Windows MSVC, windows-latest) (push) Has been cancelled
Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (gcc, Linux GCC, ubuntu-latest) (push) Has been cancelled
Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (llvm, llvm-cov gcov, Linux Clang, ubuntu-latest) (push) Has been cancelled
Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (llvm, llvm-cov gcov, MacOS clang, macos-latest) (push) Has been cancelled
Documentation / documentation (push) Has been cancelled
Bug:https://github.com/eclipse-ecal/ecal/pull/2095
This commit is contained in:
parent
805db9bdea
commit
add5f40d31
@ -4,6 +4,10 @@ Changelog
|
||||
Future release
|
||||
------------
|
||||
|
||||
### dom
|
||||
- Bugfix: Restore the `dbox` behavior from ftxui 5.0.0. To apply bgcolor
|
||||
blending between the two layers, a new `dboxBlend` will be added.
|
||||
|
||||
6.1.8 (2025-05-01)
|
||||
------------------
|
||||
|
||||
|
@ -45,59 +45,6 @@ class DBox : public Node {
|
||||
child->SetBox(box);
|
||||
}
|
||||
}
|
||||
|
||||
void Render(Screen& screen) override {
|
||||
if (children_.size() <= 1) {
|
||||
Node::Render(screen);
|
||||
return;
|
||||
}
|
||||
|
||||
const int width = box_.x_max - box_.x_min + 1;
|
||||
const int height = box_.y_max - box_.y_min + 1;
|
||||
std::vector<Pixel> pixels(std::size_t(width * height));
|
||||
|
||||
for (auto& child : children_) {
|
||||
child->Render(screen);
|
||||
|
||||
// Accumulate the pixels
|
||||
Pixel* acc = pixels.data();
|
||||
for (int x = 0; x < width; ++x) {
|
||||
for (int y = 0; y < height; ++y) {
|
||||
auto& pixel = screen.PixelAt(x + box_.x_min, y + box_.y_min);
|
||||
acc->background_color =
|
||||
Color::Blend(acc->background_color, pixel.background_color);
|
||||
acc->automerge = pixel.automerge || acc->automerge;
|
||||
if (pixel.character.empty()) {
|
||||
acc->foreground_color =
|
||||
Color::Blend(acc->foreground_color, pixel.background_color);
|
||||
} else {
|
||||
acc->blink = pixel.blink;
|
||||
acc->bold = pixel.bold;
|
||||
acc->dim = pixel.dim;
|
||||
acc->inverted = pixel.inverted;
|
||||
acc->italic = pixel.italic;
|
||||
acc->underlined = pixel.underlined;
|
||||
acc->underlined_double = pixel.underlined_double;
|
||||
acc->strikethrough = pixel.strikethrough;
|
||||
acc->hyperlink = pixel.hyperlink;
|
||||
acc->character = pixel.character;
|
||||
acc->foreground_color = pixel.foreground_color;
|
||||
}
|
||||
++acc; // NOLINT
|
||||
|
||||
pixel = Pixel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Render the accumulated pixels:
|
||||
Pixel* acc = pixels.data();
|
||||
for (int x = 0; x < width; ++x) {
|
||||
for (int y = 0; y < height; ++y) {
|
||||
screen.PixelAt(x + box_.x_min, y + box_.y_min) = *acc++; // NOLINT
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
} // namespace
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user