fix.帮雷电模拟器修复截图错误的bug

This commit is contained in:
MistEO
2021-11-04 00:44:36 +08:00
parent d425a0663c
commit c22377663e

View File

@@ -554,9 +554,15 @@ int asst::Controller::swipe_without_scale(const Rect& r1, const Rect& r2, int du
cv::Mat asst::Controller::get_image(bool raw)
{
static bool has_successful = false;
if (!screencap()) {
return cv::Mat();
// 如果之前成功截图过,这次没成功可能是一次意外,重试一次
// 点名批评雷电模拟器!
if (!(has_successful && screencap())) {
return cv::Mat();
}
}
has_successful = true;
//std::shared_lock<std::shared_mutex> image_lock(m_image_mutex);
if (raw) {
return m_cache_image;