Skip to content

Commit

Permalink
fix higher layers obscuring current layer's shapes
Browse files Browse the repository at this point in the history
  • Loading branch information
azmr committed Mar 25, 2018
1 parent 216046a commit 587c97a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions geometer.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#define _CRT_SECURE_NO_WARNINGS
#include "geometer.h"
#include <fonts.c>
#if INTERNAL
#include "geometer_debug.c"
#endif//INTERNAL

// TODO:
// =====
Expand Down Expand Up @@ -568,7 +566,7 @@ RenderDrawing(image_buffer *Buffer, state *State, basis Basis, v2 ScreenCentre,
{
colour LayerColour = BLACK;
if(ShapeLayer != State->iCurrentLayer)
{ LayerColour = LIGHT_GREY; }
{ LayerColour = PreMultiplyColour(BLACK, 0.25f); }

switch(Shape.Kind)
{
Expand Down Expand Up @@ -677,6 +675,7 @@ UPDATE_AND_RENDER(UpdateAndRender)
LOG("Invalid basis");
BASIS.XAxis.X = 1.f;
BASIS.XAxis.Y = 0.f;
BASIS.Zoom = BASIS_DEFAULT_ZOOM;
// TODO (UI): should I reset zoom here as well?
}

Expand Down Expand Up @@ -923,7 +922,7 @@ UPDATE_AND_RENDER(UpdateAndRender)
if(DEBUGPress(C_CanvasHome))
{ // reset canvas position
NewBasis.Offset = ZeroV2;
NewBasis.Zoom = 1.f;
NewBasis.Zoom = BASIS_DEFAULT_ZOOM;
SetBasis(State, NewBasis);
}

Expand Down Expand Up @@ -1945,7 +1944,9 @@ dont_append_selection:;

DEBUG_LIVE_if(Debug_ShowInfo)
{ LOG("PRINT DEBUG");
#if !SINGLE_EXECUTABLE
PrintDebugHierarchy(*ScreenBuffer, Input);
#endif//!SINGLE_EXECUTABLE
DEBUG_LIVE_if(Debug_PrintMidFrameInfo)
{ DebugPrint(); }

Expand Down
1 change: 1 addition & 0 deletions geometer.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#ifndef GEOMETER_H
#define BASIS_DEFAULT_ZOOM 0.1f
#define BASIS State->Basis
#define pBASIS State->pBasis
#define POINTS(i) Pull(State->maPoints, i)
Expand Down

0 comments on commit 587c97a

Please sign in to comment.