I'm not too sure how you're doing this, so just in case, from memory this is how NL's zoom algorithm works. If it doesn't seem to line up, let me know and I'll check this more closely.
Firstly, NeoLemmix is DPI-unaware. This means, a screen size (or window size, if playing windowed) of 3840x2160, with a 200% scaling (ie: 192dpi), appears to NeoLemmix as 1920x1080. If the editor is DPI-aware, it would need to also be aware of NL's DPI-unawareness.
Secondly, any time a non-integer results from a calculation, immediately round towards zero, unless explicitly stated otherwise.
Anyway, the play area will be zoomed to the user's zoom setting; OR, if they have "increase zoom on small levels" enabled, then it may further increase to whichever is the larger zoom of, the largest where a 320px wide level completely fits on screen horizontally, or the largest where a 160px tall level completely fits on screen vertically. For this calculation, it is assumed the skill panel will zoom to the same factor as the level, even if this is not possible for the screen size / selected skill panel.
After this, the skill panel is zoomed to whichever is less - the largest zoom that will still allow it to fit on screen (reminder: 320px wide for compact, 416px wide for standard, 48px tall either way), or the zoom factor the level has been increased to. The remaining on-screen space, after this, is what will be initially displayed of the level. (This final step can sometimes result in fractions of a pre-zoom pixel being visible on-screen - eg a 3x zoom, on a screen 1280px wide, on either the left or the right 2/3rds of a pre-zoom pixel will be visible - but I don't think the editor needs to have that level of accuracy.)