mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-02 21:30:40 +08:00
Apply suggestions from code review
Co-authored-by: Tushar Maheshwari <tushar27192@gmail.com>
This commit is contained in:
@@ -102,8 +102,8 @@ class ConstStringListRef {
|
||||
}
|
||||
|
||||
private:
|
||||
const std::vector<std::string>* const ref_ = nullptr;
|
||||
const std::vector<std::wstring>* const ref_wide_ = nullptr;
|
||||
const std::vector<std::string>* ref_ = nullptr;
|
||||
const std::vector<std::wstring>* ref_wide_ = nullptr;
|
||||
};
|
||||
|
||||
} // namespace ftxui
|
||||
|
@@ -16,9 +16,7 @@ Event Event::Character(std::string input) {
|
||||
|
||||
// static
|
||||
Event Event::Character(char c) {
|
||||
std::string input;
|
||||
input += c;
|
||||
return Event::Character(input);
|
||||
return Event::Character(std::string{c});
|
||||
}
|
||||
|
||||
// static
|
||||
|
@@ -28,7 +28,7 @@ class Text : public Node {
|
||||
int y = box_.y_min;
|
||||
if (y > box_.y_max)
|
||||
return;
|
||||
for (auto cell : Utf8ToGlyphs(text_)) {
|
||||
for (const auto& cell : Utf8ToGlyphs(text_)) {
|
||||
if (x > box_.x_max)
|
||||
return;
|
||||
screen.PixelAt(x, y).character = cell;
|
||||
@@ -43,7 +43,7 @@ class Text : public Node {
|
||||
class VText : public Node {
|
||||
public:
|
||||
VText(std::string text) : text_(text) {
|
||||
width_ = string_width(text_) ? 1 : 0;
|
||||
width_{std::min(string_width(text_), 1)}
|
||||
}
|
||||
|
||||
void ComputeRequirement() override {
|
||||
|
Reference in New Issue
Block a user