MCPcopy Create free account
hub / github.com/WallBreaker2/op / RectConvert

Method RectConvert

libop/binding/BindingSession.cpp:444–478  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

442}
443
444long BindingSession::RectConvert(long &x1, long &y1, long &x2, long &y2) {
445
446 /*if (_capture && (_display == RENDER_TYPE::NORMAL || _display == RENDER_TYPE::GDI)) {
447 x1 += _capture->_client_x; y1 += _capture->_client_y;
448 x2 += _capture->_client_x; y2 += _capture->_client_y;
449 }*/
450
451 // WGC 在窗口最小化/恢复后尺寸会异步变化,裁剪前先给后端一次刷新机会。
452 if (_capture) {
453 _capture->refreshMetrics();
454 }
455
456 x2 = std::min<long>(this->get_width(), x2);
457 y2 = std::min<long>(this->get_height(), y2);
458 if (x1 < 0 || y1 < 0 || x1 >= x2 || y1 >= y2) {
459 setlog(L"invalid rectangle:%d %d %d %d", x1, y1, x2, y2);
460 return 0;
461 }
462 // if (_capture) {
463 // if (_display == RDT_NORMAL) {//cap rect
464 // _capture->rect.left = x1;
465 // _capture->rect.top = y1;
466 // _capture->rect.right = x2;
467 // _capture->rect.bottom = y2;
468 // }
469 // else {
470 // _capture->rect.left = 0;
471 // _capture->rect.top = 0;
472 // _capture->rect.right = _capture->get_width();
473 // _capture->rect.bottom =_capture->get_height();
474 // }
475 //
476 // }
477 return 1;
478}
479
480long BindingSession::get_image_type() {
481

Callers 3

CaptureRegionFunction · 0.80
FetchWordsByRectsMethod · 0.80
with_captured_regionFunction · 0.80

Calls 4

get_widthMethod · 0.95
get_heightMethod · 0.95
setlogFunction · 0.85
refreshMetricsMethod · 0.45

Tested by

no test coverage detected