AvaloniaRider icon indicating copy to clipboard operation
AvaloniaRider copied to clipboard

Position the frame in the center

Open rstm-sf opened this issue 3 years ago • 9 comments

Hello!

It seems to me that it will be more convenient if the frame is located in the center

rstm-sf avatar Aug 30 '20 06:08 rstm-sf

@rstm-sf @ForNeVeR

I don't know a lot about Kotlin (or Java) and/or IntelliJ IDEA plugin development but I was having a look at your code today; came up with the following, happy to try help and contribute to the project if it's needed.

image

  1. Centered image in layout
  2. Background checkerboard
  3. Added Zoom(ing) ComboBox (above image is scaled to 50%)

wdcossey avatar Sep 30 '20 22:09 wdcossey

@wdcossey, this looks awesome. Have you seriously already implemented it? This is unbelievable!

ForNeVeR avatar Oct 01 '20 15:10 ForNeVeR

@ForNeVeR

Yip, it's all "implemented" (still testing), I was playing around with adding a drop-shadow too and checking that it works with various themes.

It's still a little rough around the edges so I will revert some changes and start simple and expand on that.

  1. Center the image (in the JBScrollPane) as https://github.com/ForNeVeR/AvaloniaRider/issues/83.
  2. Improve rendering (https://github.com/ForNeVeR/AvaloniaRider/issues/40), i.e. look at a custom drawn component rather than JBLabel (seems hackish).
  3. Display some basic information (i.e. width, height, etc)
  4. Add some basic controls (i.e. zoom in/out, grid, etc).
  5. Add a checkerboard/chessboard background.
  6. Toggle drop shadow.

I will fork your master branch so you can keep track of the changes I make before raising a PR.

image

wdcossey avatar Oct 01 '20 22:10 wdcossey

Still working on the changes but managed to get some rendering performance in there too (relates to https://github.com/ForNeVeR/AvaloniaRider/issues/40)

JLabel.icon (old way) - Between 38-42 FPS in the preview

image

Custom JComponent implementation - Between 48-64 FPS in the preview (seems limited to ~60 FPS even on my 144Hz monitor)

image

wdcossey avatar Oct 05 '20 13:10 wdcossey

@wdcossey does it look awesome when planning to do PR? :)

rstm-sf avatar Oct 05 '20 13:10 rstm-sf

@rstm-sf @ForNeVeR

You can pull my branch from here, build and run to have a look at it, feedback is welcome (I am not a Kotlin/Java dev 😋).

PS: I have removed the ActionToolbar with the zoom and grid options in my commits until they are tested.

wdcossey avatar Oct 05 '20 20:10 wdcossey

Hey @ForNeVeR @rstm-sf, sorry for the delay, been busy with other projects and work.

Performance Testing:

performance

Action Controls (Grid, Zoom +, Zoom -, Reset Zoom)

image

Zoom Levels are 25%, 50%, 100%, 200%, 300%, 400% and 800%

Grid is only visible at zoom levels 200% and up

200%

image

300%

image

400%

image

800%

image

wdcossey avatar Oct 13 '20 11:10 wdcossey

@wdcossey, this is awesome. Do you want me to start PR from your branch myself? I could do that.

ForNeVeR avatar Oct 18 '20 16:10 ForNeVeR

@ForNeVeR

Sure, you're more than welcome to start a PR, leave some comments and and make the changes if needed.

wdcossey avatar Oct 20 '20 20:10 wdcossey

Ok, this was done some time ago.

ForNeVeR avatar Oct 12 '22 21:10 ForNeVeR