I need to apply a custom clip/scissor rect to a DrawFittedBitmap() call (tested on NanoVG), to crop (not scale) the output to a custom rectangle.
EDIT: this works:
g->PathClipRegion(clip_rect);
g->DrawFittedBitmap(...);
// 'turn off' the clip region by setting it to the plugin dimension
g->PathClipRegion({0, 0, PLUG_WIDTH, PLUG_HEIGHT});
but ideally I’d like to restore the existing clip region, if any. is there a way to do that? or is there another way to clip a fitted bitmap?