openframeworks / openframeworks/openFrameworks

Bug : Orientation, vFlip and viewports

Open
#3,130 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug core section-2D
Dominant language
C++
Stars
10.4k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
9

Description

I think the line in ofMatrixStack.cpp:

https://github.com/openframeworks/openFrameworks/blob/cf0064494962e7d16dd1f756f08ca746ed726bf6/libs/openFrameworks/utils/ofMatrixStack.cpp#L133

    if (vflip){
        y = getRenderSurfaceHeight() - (y + height);
    }

should be:

    if (vflip && !(!doesHWOrientation() && OF_ORIENTATION_90_RIGHT)){
        y = getRenderSurfaceHeight() - (y + height);
    }

this seems to fix things for me (iPad in horizontal with home button on left, whichi is OF_ORIENTATION_90_RIGHT). but my mind isn't very trained right now to understand all the orientation flags, so advice is welcome

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in libs/openFrameworks/utils/ofMatrixStack.cpp at the linked line and trace how vflip, doesHWOrientation(), and OF_ORIENTATION_90_RIGHT affect viewport coordinates. Reproduce the reported iPad landscape case with the home button on the left, then verify that viewport positioning is correct without breaking other orientations. Done means the orientation-specific viewport behavior is confirmed and covered by the project’s available validation path.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.