Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: solvespace/solvespace
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 64c0f62b92a3
Choose a base ref
...
head repository: solvespace/solvespace
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 16c5fa688920
Choose a head ref
  • 1 commit
  • 4 files changed
  • 1 contributor

Commits on Dec 17, 2019

  1. Copy the full SHA
    16c5fa6 View commit details
Showing with 8 additions and 8 deletions.
  1. +4 −4 src/render/rendergl1.cpp
  2. +2 −2 src/solvespace.cpp
  3. +1 −1 src/srf/surface.cpp
  4. +1 −1 src/toolbar.cpp
8 changes: 4 additions & 4 deletions src/render/rendergl1.cpp
Original file line number Diff line number Diff line change
@@ -708,8 +708,8 @@ void OpenGl1Renderer::UpdateProjection() {
UnSelectPrimitive();

glViewport(0, 0,
camera.width * camera.pixelRatio,
camera.height * camera.pixelRatio);
(GLsizei)(camera.width * camera.pixelRatio),
(GLsizei)(camera.height * camera.pixelRatio));

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
@@ -821,8 +821,8 @@ void OpenGl1Renderer::FinishFrame() {
}

std::shared_ptr<Pixmap> OpenGl1Renderer::ReadFrame() {
int width = camera.width * camera.pixelRatio;
int height = camera.height * camera.pixelRatio;
int width = (int)(camera.width * camera.pixelRatio);
int height = (int)(camera.height * camera.pixelRatio);
std::shared_ptr<Pixmap> pixmap =
Pixmap::Create(Pixmap::Format::RGB, (size_t)width, (size_t)height);
glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, &pixmap->data[0]);
4 changes: 2 additions & 2 deletions src/solvespace.cpp
Original file line number Diff line number Diff line change
@@ -361,7 +361,7 @@ std::string SolveSpaceUI::MmToStringSI(double v, int dim) {
}

v /= pow((viewUnits == Unit::INCHES) ? 25.4 : 1000, dim);
int vdeg = floor((log10(fabs(v))) / dim);
int vdeg = (int)((log10(fabs(v))) / dim);
std::string unit;
if(fabs(v) > 0.0) {
int sdeg = 0;
@@ -371,7 +371,7 @@ std::string SolveSpaceUI::MmToStringSI(double v, int dim) {
: SelectSIPrefixMm(vdeg);
v /= pow(10.0, sdeg * dim);
}
int pdeg = ceil(log10(fabs(v) + 1e-10));
int pdeg = (int)ceil(log10(fabs(v) + 1e-10));
return ssprintf("%#.*g%s%s%s", pdeg + UnitDigitsAfterDecimal(), v,
compact ? "" : " ", unit.c_str(), DimToString(dim));
}
2 changes: 1 addition & 1 deletion src/srf/surface.cpp
Original file line number Diff line number Diff line change
@@ -646,7 +646,7 @@ void SShell::MakeFromHelicalRevolutionOf(SBezierLoopSet *sbls, Vector pt, Vector
// for testing - hard code the axial distance, and number of sections.
// distance will need to be parameters in the future.
double dist = distf - dists;
int sections = fabs(anglef - angles) / (PI / 2) + 1;
int sections = (int)(fabs(anglef - angles) / (PI / 2) + 1);
double wedge = (anglef - angles) / sections;

if(CheckNormalAxisRelationship(sbls, pt, axis, anglef-angles, distf-dists)) {
2 changes: 1 addition & 1 deletion src/toolbar.cpp
Original file line number Diff line number Diff line change
@@ -219,7 +219,7 @@ bool GraphicsWindow::ToolbarDrawOrHitTest(int mx, int my, UiCanvas *canvas,
{
if(hitCommand) *hitCommand = icon.command;
if(hitX) *hitX = x - boxhw;
if(hitY) *hitY = height - (y + boxhw);
if(hitY) *hitY = (int)height - (y + boxhw);
}
}