  
    // Don't draw on top of sidebar
    nvgScissor(s->vg, scene->viz_rect.x, scene->viz_rect.y, scene->viz_rect.w, scene->viz_rect.h);
  
    // Apply transformation such that video pixel coordinates match video
    // 1) Put (0, 0) in the middle of the video
    nvgTranslate(s->vg, s->video_rect.x + s->video_rect.w / 2, s->video_rect.y + s->video_rect.h / 2 + y_offset);
  
    // 2) Apply same scaling as video
    nvgScale(s->vg, zoom, zoom);
  
    // 3) Put (0, 0) in top left corner of video
    nvgTranslate(s->vg, -intrinsic_matrix.v[2], -intrinsic_matrix.v[5]);
  
    // Draw lane edges and vision/mpc tracks
    ui_draw_vision_lane_lines(s);
  
    // Draw lead indicators if openpilot is handling longitudinal
    if (s->longitudinal_control) {
 
</s> remove 
  nvgSave(s->vg);

 </s> add  </s> remove   out->x = KEp.v[0] / KEp.v[2];
  out->y = KEp.v[1] / KEp.v[2];
 </s> add   float x = KEp.v[0] / KEp.v[2];
  float y = KEp.v[1] / KEp.v[2]; </s> remove   sz = std::clamp((sz * 30) / (x_in / 3 + 30), 15.0f, 30.0f);
 </s> add   sz = std::clamp((sz * 30) / (x_in / 3 + 30), 15.0f, 30.0f) * zoom;
  y = std::fmin(s->scene.viz_rect.bottom() - sz * .6,  y);
  x = std::clamp(x, 0.f, s->scene.viz_rect.right() - sz / 2); </s> remove   vertex_data out;
  if (!car_space_to_full_frame(s, x_in, y_in, 0.0, &out)) return;
 </s> add   vertex_data out = {};
  car_space_to_full_frame(s, x_in, y_in, 0.0, &out);
  
    // Don't draw on top of sidebar
    nvgScissor(s->vg, scene->viz_rect.x, scene->viz_rect.y, scene->viz_rect.w, scene->viz_rect.h);
  










    // Draw lane edges and vision/mpc tracks
    ui_draw_vision_lane_lines(s);
  
    // Draw lead indicators if openpilot is handling longitudinal
    if (s->longitudinal_control) {
keep keep keep keep replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 UI: refactor transform (#19658)

* refactor transform

* always draw chevron if there is a lead

* remove nvgSave&nvgRestore

* keep one point outside the screen

* zoom chevron

* more size

* still use margin

* still use margin 
selfdrive/ui/paint.cc