Skip to content

Commit

Permalink
Only use catrom at finest mipmap level.
Browse files Browse the repository at this point in the history
Reduce minimum zoom level to 0.45.
  • Loading branch information
cmbruns committed Jun 20, 2024
1 parent 2cba7f5 commit 53d8136
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion vmg/shared.frag
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ vec4 clip_n_filter(sampler2D image, vec2 tc, int pixelFilter, bool wrap)
return vec4(0);
}

if (pixelFilter == FILTER_NEAREST) {
float mipmapLevel = textureQueryLod(image, tc).x;
if (mipmapLevel > 0 || pixelFilter == FILTER_NEAREST)
{
if (wrap)
return nearest_wrap(image, tc);
else
Expand Down
4 changes: 2 additions & 2 deletions vmg/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,8 @@ def zoom_relative(self, zoom_factor: float, zoom_center: Optional[QPoint]):
old_zoom = self._zoom
new_zoom = self._zoom * zoom_factor
# Limit zoom-out because you never need more than twice the image dimension to move around
if new_zoom <= 1:
new_zoom = 1
if new_zoom <= 0.45:
new_zoom = 0.45
self._zoom = new_zoom
if zoom_center is not None:
p_qwn = LocationQwn(zoom_center.x(), zoom_center.y(), 1)
Expand Down

0 comments on commit 53d8136

Please sign in to comment.