Skip to content

Commit

Permalink
Selection overlay has now solid corners
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrieleGiuseppini committed Oct 15, 2022
1 parent 9d3b67c commit 07ce042
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Data/Shaders/ShipBuilder/dashed_line_overlay.glsl
Expand Up @@ -36,8 +36,8 @@ void main()
{
float inDash = mod(pixelCoord, 2.0 * paramPixelStep);
float lineDepth =
smoothstep(0.0, 2.0, inDash)
- smoothstep(paramPixelStep, paramPixelStep + 2.0, inDash);
step(0.0, inDash)
- step(paramPixelStep, inDash);

gl_FragColor = mix(
vec4(.7, .7, .7, .5),
Expand Down
10 changes: 10 additions & 0 deletions ShipBuilder TODO.txt
Expand Up @@ -269,9 +269,19 @@
+ Clone of OnMeasuredWorldLengthChanged
+ Between tool coordinates and sampled material
+ We have an icon for that, "selection_size"
+ Selection overlay: corners w/pixels
- Fix issue:
- ModelValidationDialog calls Controller::ValidateModel() from separate thread, which first suspends tool and then, when done, resumes the tool and
thus *creates* the tool (after our last change), causing OpenGL calls from separate thread
- Option A: explicit suspend (w/scope); keep using thread
- Option B:
- No thread
- Controller::StartValidation() -> Validator
- Also suspends and stores scoped thing in Validator - cleared at Validator dctor
- Dialog stores Validator in opt (e.g. session data) and destroys when done
- Timer advances Validator until it's done
- And then destroy Validator in opt

= Copy & Cut buttons:
+ Buttons at "Edit" ribbon (new own section)
+ Reconciliation with selection: enable/disable
Expand Down
2 changes: 1 addition & 1 deletion ShipBuilderLib/Tools/SelectionTool.cpp
Expand Up @@ -68,7 +68,7 @@ SelectionTool::SelectionTool(
, mEngagementData()
, mIsShiftDown(false)
{
SetCursor(WxHelpers::LoadCursorImage("selection_cursor", 10, 10, resourceLocator));
SetCursor(WxHelpers::LoadCursorImage("selection_cursor", 11, 11, resourceLocator));
}

SelectionTool::~SelectionTool()
Expand Down
4 changes: 2 additions & 2 deletions ShipBuilderLib/View.cpp
Expand Up @@ -2011,10 +2011,10 @@ void View::UpdateSelectionOverlay()
// Calculate width and height, in ship (signed) and in pixels (absolute)
float const shipWidth = cornerB.x - cornerA.x;
float absPixelWidth = mViewModel.FractionalShipSpaceOffsetToFractionalPhysicalDisplayOffset(std::abs(shipWidth));
absPixelWidth = std::round(absPixelWidth / SelectionOverlayPixelStep) * SelectionOverlayPixelStep;
absPixelWidth = std::round(absPixelWidth / SelectionOverlayPixelStep) * SelectionOverlayPixelStep + SelectionOverlayPixelStep / 2.0f;
float const shipHeight = cornerB.y - cornerA.y;
float absPixelHeight = mViewModel.FractionalShipSpaceOffsetToFractionalPhysicalDisplayOffset(std::abs(shipHeight));
absPixelHeight = std::round(absPixelHeight / SelectionOverlayPixelStep) * SelectionOverlayPixelStep;
absPixelHeight = std::round(absPixelHeight / SelectionOverlayPixelStep) * SelectionOverlayPixelStep + SelectionOverlayPixelStep / 2.0f;

// One pixel in ship space
float const shipSpaceQuantum = mViewModel.GetShipSpaceForOnePhysicalDisplayPixel();
Expand Down

0 comments on commit 07ce042

Please sign in to comment.