Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BaseLine drawing issue #40

Open
homer90 opened this issue Nov 17, 2015 · 4 comments
Open

BaseLine drawing issue #40

homer90 opened this issue Nov 17, 2015 · 4 comments

Comments

@homer90
Copy link

homer90 commented Nov 17, 2015

When dragging one tab to another form the baseline gets rendered "behind" the tab.

Now: http://gfycat.com/SneakyRealIraniangroundjay

        // Only draw if not (!)dragging tab  <-----------------------
        if FDragTabControl = nil then
        begin
          case FOptions.Display.Tabs.Orientation of
            toTop: TabCanvas.DrawLine(Pen, 0, TabContainerRect.Bottom - 1, CorrectedClientWidth, TabContainerRect.Bottom - 1);
            toBottom: TabCanvas.DrawLine(Pen, 0, TabContainerRect.Top, CorrectedClientWidth, TabContainerRect.Top);
          end;
        end;

        // Restore the tab clip region
        SetTabClipRegion;

        // Draw the active tab
        if (ActiveTabIndex <> -1) and
           (ActiveTabVisible) and
           (TabControls[ActiveTabIndex].ControlRect.Right >= ScrollOffset) and
           (TabControls[ActiveTabIndex].ControlRect.Left <= CorrectedClientWidth + ScrollOffset) then
          TabControls[ActiveTabIndex].DrawTo(TabCanvas, FLastMouseX, FLastMouseY);

        // Clear the clip region
        TabCanvas.ResetClip;

        // Only draw if dragging tab  <-----------------------
        if FDragTabControl <> nil then
        begin
          case FOptions.Display.Tabs.Orientation of
            toTop: TabCanvas.DrawLine(Pen, 0, TabContainerRect.Bottom - 1, CorrectedClientWidth, TabContainerRect.Bottom - 1);
            toBottom: TabCanvas.DrawLine(Pen, 0, TabContainerRect.Top, CorrectedClientWidth, TabContainerRect.Top);
          end;
        end;

After fix: http://gfycat.com/FlippantVagueChihuahua

@norgepaul
Copy link
Owner

Hi,

Sorry, I don't see any difference in the videos. The baseline seems to get
rendered correctly in both. Can you point out exactly what the issue is?

Was the code included in the email a fix?

Cheers,
Paul

On 17 November 2015 at 20:00, homer90 notifications@github.com wrote:

When dragging one tab to another form the baseline gets rendered "behind"
the tab.

Now: http://gfycat.com/SneakyRealIraniangroundjay

    // Only draw if not (!)dragging tab  <-----------------------
    if FDragTabControl = nil then
    begin
      case FOptions.Display.Tabs.Orientation of
        toTop: TabCanvas.DrawLine(Pen, 0, TabContainerRect.Bottom - 1, CorrectedClientWidth, TabContainerRect.Bottom - 1);
        toBottom: TabCanvas.DrawLine(Pen, 0, TabContainerRect.Top, CorrectedClientWidth, TabContainerRect.Top);
      end;
    end;

    // Restore the tab clip region
    SetTabClipRegion;

    // Draw the active tab
    if (ActiveTabIndex <> -1) and
       (ActiveTabVisible) and
       (TabControls[ActiveTabIndex].ControlRect.Right >= ScrollOffset) and
       (TabControls[ActiveTabIndex].ControlRect.Left <= CorrectedClientWidth + ScrollOffset) then
      TabControls[ActiveTabIndex].DrawTo(TabCanvas, FLastMouseX, FLastMouseY);

    // Clear the clip region
    TabCanvas.ResetClip;

    // Only draw if dragging tab  <-----------------------
    if FDragTabControl <> nil then
    begin
      case FOptions.Display.Tabs.Orientation of
        toTop: TabCanvas.DrawLine(Pen, 0, TabContainerRect.Bottom - 1, CorrectedClientWidth, TabContainerRect.Bottom - 1);
        toBottom: TabCanvas.DrawLine(Pen, 0, TabContainerRect.Top, CorrectedClientWidth, TabContainerRect.Top);
      end;
    end;

After fix: http://gfycat.com/FlippantVagueChihuahua


Reply to this email directly or view it on GitHub
#40.

@homer90
Copy link
Author

homer90 commented Nov 17, 2015

before:
bbbb

after:
aaaa

The code i included is indeed the fix.

@norgepaul
Copy link
Owner

Hi,

Unfortunately, the fix you posted doesn't work for me.

  1. The baseline is drawn in front of the drag tab
  2. When dragging a tab over another tab container it is no longer visible.

I'm still having a hard time figuring out what the actual issue is though, When I drag a tab the baseline is clearly visible in front of all the other tabs, not just because of the transparency settings.

The only issue I can see is that the baseline is visible if the drag tab has some transparency,

Can you give me any more information to go on or provide a fix that works correctly?

Cheers,
Paul

@homer90
Copy link
Author

homer90 commented Nov 19, 2015

That's weird cause the fix is working for me as posted in the video (http://gfycat.com/FlippantVagueChihuahua).

The glitch happens when you drag one tab in another container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants