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

When grid is very small it takes a long time to load #25

Open
Karjala22 opened this issue Jun 12, 2021 · 2 comments
Open

When grid is very small it takes a long time to load #25

Karjala22 opened this issue Jun 12, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@Karjala22
Copy link
Contributor

See if there is a way to improve the grid drawing when there are many points

image

@Karjala22 Karjala22 added the enhancement New feature or request label Jun 12, 2021
@Karjala22
Copy link
Contributor Author

Why is it recalculating M2DX(i) for each outer loop ?

procedure TMapWindow.DO_DrawGrid;
var i, j   : Integer;
    TheMsg : TMsg;
begin
  with Map.Canvas do
    begin
      i := Round(S2MX(0)/Grid)*Grid-Grid;
      while  i <= Round(S2MX(ScreenX)/Grid)*Grid+Grid do
        begin
          if FastSCROLL and
           (PeekMessage(TheMsg, 0, WM_KEYUP,   WM_KEYUP,   PM_NOYIELD or PM_NOREMOVE) or
            PeekMessage(TheMsg, 0, WM_LBUTTONDOWN, WM_LBUTTONDOWN, PM_NOYIELD or PM_NOREMOVE))
              then Break;
          j := Round(S2MZ(ScreenZ)/Grid)*Grid-Grid;
          while j <= Round(S2MZ(0)/Grid)*Grid+Grid do
            begin
              SetPixel(Handle, **M2SX(i),** M2SZ(j), col_grid);
              Inc(j ,Grid);
            end;
          Inc(i, Grid);
        end;
    end;
end;

@Karjala22
Copy link
Contributor Author

Will rewrite to include dynamic grids drawing.

Karjala22 added a commit that referenced this issue Jun 19, 2021
This was referenced Jun 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant