  
        x_offset = std::clamp(x_offset_, -max_x_offset, max_x_offset);
        y_offset = std::clamp(y_offset_, -max_y_offset, max_y_offset);
  
        float zx = zoom * 2 * intrinsic_matrix.v[2] / width();
        float zy = zoom * 2 * intrinsic_matrix.v[5] / height();
        const mat4 frame_transform = {{
          zx, 0.0, 0.0, -x_offset / width() * 2,
          0.0, zy, 0.0, y_offset / height() * 2,
          0.0, 0.0, 1.0, 0.0,
          0.0, 0.0, 0.0, 1.0,
 
</s> remove   auto [x1, x2, y1, y2] = stream_type == VISION_STREAM_DRIVER ? std::tuple(0.f, 1.f, 1.f, 0.f) : std::tuple(1.f, 0.f, 1.f, 0.f);
 </s> add   auto [x1, x2, y1, y2] = requested_stream_type == VISION_STREAM_DRIVER ? std::tuple(0.f, 1.f, 1.f, 0.f) : std::tuple(1.f, 0.f, 1.f, 0.f); </s> remove 
  if (sm.updated("carState")) {
    float v_ego = sm["carState"].getCarState().getVEgo();
    // TODO: support replays without ecam by using fcam
    // Wide or narrow cam dependent on speed
    if ((v_ego < 10) || s->wide_cam_only) {
      scene.wide_cam = true;
    } else if (v_ego > 15) {
      scene.wide_cam = false;
    }
  }
 </s> add  </s> remove   std::atomic<VisionStreamType> stream_type;
 </s> add   std::atomic<VisionStreamType> active_stream_type;
  std::atomic<VisionStreamType> requested_stream_type; </s> remove   std::mutex frame_lock;
 </s> add   std::recursive_mutex frame_lock; </s> remove static int get_path_length_idx(const cereal::ModelDataV2::XYZTData::Reader &line, const float path_height) {
 </s> add int get_path_length_idx(const cereal::ModelDataV2::XYZTData::Reader &line, const float path_height) {
      float zx = zoom * 2 * intrinsic_matrix.v[2] / w;
      float zy = zoom * 2 * intrinsic_matrix.v[5] / h;
  
        x_offset = std::clamp(x_offset_, -max_x_offset, max_x_offset);
        y_offset = std::clamp(y_offset_, -max_y_offset, max_y_offset);
  
      float zx = zoom * 2 * intrinsic_matrix.v[2] / w;
      float zy = zoom * 2 * intrinsic_matrix.v[5] / h;
      float zx = zoom * 2 * intrinsic_matrix.v[2] / w;
      float zy = zoom * 2 * intrinsic_matrix.v[5] / h;
        const mat4 frame_transform = {{
          zx, 0.0, 0.0, -x_offset / width() * 2,
          0.0, zy, 0.0, y_offset / height() * 2,
          0.0, 0.0, 1.0, 0.0,
          0.0, 0.0, 0.0, 1.0,
keep keep keep keep replace replace keep keep keep keep keep
 UI: draw onroad objects on right frame (#26306)

* update before draw

* fix a lot of janky

* fix more flicker

* cleanup

* fix flicker when opening settings

* simplify 
selfdrive/ui/qt/widgets/cameraview.cc