Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
My first python plugin review
#3
Shocked 
Thanks Ofnuts Smile  .

I've implemented most of your suggestions. The only ones I didn't are listed below with reasons why
  • lots of  common code between the two if/elif blocks. Some of it could be taken out. Personally, I would just set the new canvas/width or height. Then outside of the conditions the code would take care of offsets and such. Yes, the computations would yield  0 for one of the values...
The code is very similar, but the values inside the if/elif blocks need to be calculated based on the canvas_width or canvas_height respectively.
  • I don't see the purpose of computing bg_scale, since anyway the background will be sized to the new  canvas dimensions that you already have.
The background will actually overflow the new canvas size (see attached image). If I just resized the image to the new canvas size, it wouldn't have the same aspect ratio and would be squished horizontally or vertically

Let me know if there's anything else that can be improved.


Attached Files Thumbnail(s)
   
Reply


Messages In This Thread
My first python plugin review - by origamifreak2 - 12-28-2024, 02:59 AM
RE: My first python plugin review - by Ofnuts - 12-28-2024, 09:08 AM
RE: My first python plugin review - by origamifreak2 - 12-28-2024, 10:49 PM
RE: My first python plugin review - by Ofnuts - 12-29-2024, 09:18 AM
RE: My first python plugin review - by gasMask - 12-29-2024, 12:22 AM
RE: My first python plugin review - by Ofnuts - 12-31-2024, 09:56 PM
RE: My first python plugin review - by Ofnuts - 01-01-2025, 09:26 AM
RE: My first python plugin review - by Ofnuts - 01-06-2025, 09:03 AM
RE: My first python plugin review - by Ofnuts - Yesterday, 09:18 AM

Forum Jump: