Skip to content

Commit

Permalink
Merge pull request #1484 from zenustech/image_panel_cursor_info
Browse files Browse the repository at this point in the history
info rgba
  • Loading branch information
legobadman authored Oct 23, 2023
2 parents 3f4e0e4 + 377771a commit 0fb64da
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions ui/zenoedit/panel/zenoimagepanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,24 +245,13 @@ ZenoImagePanel::ZenoImagePanel(QWidget *parent) : QWidget(parent) {
int i = (height - 1 - h) * width + w;
auto c = obj->verts[i];
std::string info = zeno::format("width: {}, height: {}", width, height);
info += zeno::format(" | x: {}, y: {}", w, h);
if (pMode->currentText() == "RGB") {
info += zeno::format(" | value: {}, {}, {}", c[0], c[1], c[2]);
info += zeno::format(" | x: {:5}, y: {:5}", w, h);
if (obj->verts.has_attr("alpha")) {
auto &alpha = obj->verts.attr<float>("alpha");
info += zeno::format(" | value: {:6f}, {:6f}, {:6f}, {:6f}", c[0], c[1], c[2], alpha[i]);
}
else if (pMode->currentText() == "Red") {
info += zeno::format(" | value: {}", c[0]);
}
else if (pMode->currentText() == "Green") {
info += zeno::format(" | value: {}", c[1]);
}
else if (pMode->currentText() == "Blue") {
info += zeno::format(" | value: {}", c[2]);
}
else if (pMode->currentText() == "Alpha") {
if (obj->verts.has_attr("alpha")) {
auto &alpha = obj->verts.attr<float>("alpha");
info += zeno::format(" | value: {}", alpha[i]);
}
else {
info += zeno::format(" | value: {:6f}, {:6f}, {:6f}", c[0], c[1], c[2]);
}

QString statusInfo = QString(info.c_str());
Expand Down

0 comments on commit 0fb64da

Please sign in to comment.