fix an issue that created Node goes away
This commit is contained in:
parent
fa6d7c36ed
commit
5d796635b7
@ -249,7 +249,7 @@ class Network final : public nf7::FileBase,
|
||||
void Config() noexcept;
|
||||
|
||||
ImVec2 GetCanvasPosFromScreenPos(const ImVec2& pos) noexcept {
|
||||
return pos - canvas_pos_ - canvas_.Offset/canvas_.Zoom;
|
||||
return (pos - canvas_pos_ - canvas_.Offset)/canvas_.Zoom;
|
||||
}
|
||||
};
|
||||
|
||||
@ -919,6 +919,14 @@ void Network::Item::Watcher::Handle(const File::Event& ev) noexcept {
|
||||
}
|
||||
return;
|
||||
|
||||
case nf7::File::Event::kReqFocus:
|
||||
if (item.owner_) {
|
||||
auto& net = *item.owner_;
|
||||
net.win_.SetFocus();
|
||||
net.canvas_.Offset = item.pos_ * -net.canvas_.Zoom;
|
||||
}
|
||||
return;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user