helmerapp / micro

top notch GIFs, right from your desktop
https://www.helmer.app/micro
Other
41 stars 8 forks source link

fix: adjust for fractional scaling when recording on windows platform #83

Closed amit-chaudhari1 closed 4 months ago

amit-chaudhari1 commented 4 months ago

Context

If you are using fractional scaling (windows display setting, called different in other platforms) , we observe that the recorded areas are incorrect.

They are offset by a certain ratio. this is incorrect (obviously)

Description

we are multiplying the coordinates with the scale_factor

Changes in the codebase

multiplications with scale_factor before passing in options to scap.

Considerations for future

need to test on mac and *nix (especially those with scale factors other than 1)

Additional Information

scap takes in CGPoint and CGSize.

amit-chaudhari1 commented 4 months ago

I'm also introducing way for you to debug by setting breakpoint in vscode (hacky)

clearlysid commented 4 months ago

Tbh I think scap should be responsible for the scale factor, like it does on macOS. @Pranav2612000 wdyt?

clearlysid commented 4 months ago

scap takes in CGPoint and CGSize.

For the record I think these should be renamed asap too. They're macOS proprietary API names and imo we should instead just pass in regular tuples of f64s.

clearlysid commented 4 months ago

@amit-chaudhari1 assuming you can't pick up the scap changes so I'm proceeding with making them myself. Scap issue for tracking this: https://github.com/helmerapp/scap/issues/61

The CGPoint, CGSize, CGRect etc. have been renamed to more generic ones in this PR https://github.com/helmerapp/scap/pull/67