NEW PLUGIN! NeoFit 6/7/26 - Page 2 - Forum

Forum Navigation
You need to log in to create posts and topics.

NEW PLUGIN! NeoFit 6/7/26

PreviousPage 2 of 2

ALEJANDRO, I am sorry but I really don't have the time to troubleshot the NeoFit for groups plugin and I really don't think scaling and repositioning groups will work correctly... The original NeoFit plugin scales and repositions objects directly... so I would use that...

To handle different pages in your pub, you should create a subroutine with all the resize code logic for each page in your pub, and call your subroutine each time you switch pages in the Page Enter event... Here is NeoFit subroutine code for one of my projects I am working on...

:onPage1
NeoFit_Clear
NeoFit_SetDesignSize "1920" "1080"

NeoFit_RegisterObject "Main_Screen" "UNIFORM" "UNIFORM" "L" "T" "0" "0"
NeoFit_RegisterObject "Intetion" "UNIFORM" "UNIFORM" "L" "T" "0" "0"
NeoFit_RegisterObject "Prayers" "UNIFORM" "UNIFORM" "L" "T" "0" "0"
NeoFit_RegisterObject "Grounding" "UNIFORM" "UNIFORM" "L" "T" "0" "0"
NeoFit_RegisterObject "Protection" "UNIFORM" "UNIFORM" "L" "T" "0" "0"
NeoFit_Apply
Return

:onPage2
NeoFit_Clear
NeoFit_SetDesignSize "1920" "1080"

NeoFit_RegisterObject "Background" "UNIFORM" "UNIFORM" "L" "T" "0" "0"
NeoFit_RegisterObject "Torch1" "UNIFORM" "UNIFORM" "L" "T" "0" "0"
NeoFit_RegisterObject "Torch2" "UNIFORM" "UNIFORM" "L" "T" "0" "0"
NeoFit_RegisterObject "Flame1" "FIXED" "UNIFORM" "L" "T" "0" "0"
NeoFit_RegisterObject "Flame2" "FIXED" "UNIFORM" "L" "T" "0" "0"

NeoFit_PinObject "Flame1" "Torch1" "BC" "TC" "0" "9"
NeoFit_PinObject "Flame2" "Torch2" "BC" "TC" "0" "9"
NeoFit_Apply
Return

I know you have a lot or groups in your publication... Maybe you could try ungrouping the objects and register each object... using the original NeoFit version without the group feature... Just remember to create a subroutine for each page in your publication and call the subroutine in the Page Enter event... example: GoSub "Page1" etc...

I was hoping the grouped objects feature would work in the plugin but it doesn't seam this is the best use for NeoFit.

Hope that helps...

@anthony-latorre

Hello,

I am experiencing an issue with the NeoFit plugin in a VisualNEO Win project.

My publication is designed at a base resolution of 1280x720, and I am using NeoFit to adapt the pages to fullscreen.

For each page I currently use a routine similar to this:

NeoFit_Clear
NeoFit_SetDesignSize "1280" "720"
NeoFit_RegisterObject ...
NeoFit_RegisterObject ...
NeoFit_Apply

This works perfectly when I enter the page for the first time. All registered objects are resized and positioned correctly.

The problem occurs when navigating between pages.

For example:

  1. I start on the Main page.
  2. NeoFit is applied and the Main page looks correct in fullscreen.
  3. I navigate to another page, where I also use NeoFit.
  4. That second page is displayed correctly.
  5. When I return to the Main page, the layout becomes distorted. Objects no longer have the same correct positions and sizes they had when the Main page was initially displayed.

It appears that when I return to the Main page and execute NeoFit_Clear followed by NeoFit_RegisterObject again, NeoFit may be registering the objects using their CURRENT resized coordinates and dimensions instead of their original design-time coordinates (1280x720).

If NeoFit_Apply is then executed again, this seems to cause cumulative/double scaling.

I checked the available NeoFit commands and I can see:

NeoFit_Apply
NeoFit_Clear
NeoFit_InitDPI
NeoFit_PinObject
NeoFit_RegisterObject
NeoFit_SetDesignSize

My questions are:

  1. What is the correct way to use NeoFit when navigating repeatedly between pages?
  2. Should NeoFit_RegisterObject be executed only once for each page/object instead of every time the page is entered?
  3. Does NeoFit_Clear delete the original coordinates and dimensions stored by NeoFit?
  4. Is there a way to restore the registered objects to their original design-time coordinates before registering/applying them again?
  5. Should all objects from all pages be registered once when the publication starts, and then only NeoFit_Apply be used when changing pages?

The important point is that NeoFit works perfectly the first time each page is displayed. The distortion only appears when returning to a page that has already been resized by NeoFit.

I can provide the VisualNEO Win .pub project and the exact routines if needed.

Thank you.

@anthony-latorre

ALEJANDRO, I have attached a publication that sizes and positions a button centered on the page... There are 2 pages and it shows you how to rescale and reposition objects on multiple pages... It's a simple example but it should help you...

I am going away for a week and I won't have access to my computer until I get back... So study this pub and see if it helps...

Uploaded files:

@anthony-latorre

Thanks for your reply and example, but I'm not having any problems with the object layout; they register correctly, just like in your example, and Maximina resizes them to fit the monitor screen... that makes it excellent. The problem is that when you go from one page to another and then back to the previous one, everything gets messed up; it doesn't stay the same and the objects aren't respected. Have a good trip. When you get back, I'll send you the post with two pages so you can verify what I'm talking about.

ALEJANDRO, here are some tips to help you... And I uploaded the latest working plugin... Make sure you use it...

1. Correct usage across pages: In each page's Page Enter: NeoFit_Clear, then NeoFit_SetDesignSize, then one NeoFit_RegisterObject per object on that page, then NeoFit_Apply. In the pub's Resized event: just NeoFit_Apply, nothing else. Don't re-run the Clear/Register routine on resize.

2. Register once or every entry? Every page entry is correct and safe. NeoFit captures an object's design-time rectangle only the first time it ever sees that object name, and reuses that stored rectangle on every later registration. Re-registering does not re-snapshot the current on-screen geometry.

3. Does Clear delete the original coordinates? No. Clear restores registered objects toward their design geometry and empties the working registry, but the stored design-time rectangles survive Clear and page changes. They're only reset when the pub starts running.

4. Restoring design coordinates: You don't need to do this manually — that's what the capture-once store exists for. Apply always computes from the stored 1280x720 design rects, never from current screen positions.

5. Register all pages at startup? No — objects on non-visible pages don't exist as windows yet, so those registrations can't resolve. Register only the current page's objects, at page enter.

Since your structure is already right, the distortion points at one of two things:

a) Plugin version. Older NeoFit builds re-captured the object's current (already-scaled) rectangle on re-registration, which causes exactly the cumulative scaling you describe. Make sure you're on the latest NeoFit .nbp — this was specifically fixed. Delete the old copy from VisualNEO's plugin folder and reinstall the current one, then recompile.

b) Duplicate object names across pages. The design-rect store is keyed by object name across the whole pub. If two different pages both contain, say, "Image1" but with different design geometry, the second one will inherit the first one's stored rectangle. Give every registered object a unique name pub-wide.

Uploaded files:

@anthony-latorre   yes! NEW FOUND OK!!!!
All pages and objet to found ....
Thanks master for you time an help

Best Regards

Anthony LaTorre has reacted to this post.
Anthony LaTorre
PreviousPage 2 of 2