Skip to content

Commit

Permalink
Update 0.8 pre1
Browse files Browse the repository at this point in the history
  • Loading branch information
makuke1234 committed Jan 27, 2022
1 parent 467d16f commit d4a7aa1
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 12 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ The x86 (32-bit) Windows binaries can be downloaded [here](https://github.com/ma
# Changelog

* 0.8 (planned)
* [ ] Fully get rid of flickering (as much as possible anyways)
* Fully get rid of flickering (as much as possible anyways)
* Reset zoom on page change
* Make zooming less aggressive (+- 10% at a time)
* [ ] Add more status bar functionality
* [ ] Add zooming capability
* [ ] Add zooming capability itself

* 0.7
* Fix bugs with command-line usage
Expand Down
6 changes: 3 additions & 3 deletions src/hdcbuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ void pdfv::hdc::Renderer::clear() noexcept
{
return this->bmBuffer.find(pageIdx) != this->bmBuffer.end();
}
void pdfv::hdc::Renderer::putPage(std::size_t pageIdx, xy<int> pos, xy<int> size, std::function<Renderer::RenderT (void *)> render, void * renderArg)
void pdfv::hdc::Renderer::putPage(std::size_t pageIdx, xy<int> size, std::function<Renderer::RenderT (void *)> render, void * renderArg)
{
bool reRender{ true };
if (auto it{ this->bmBuffer.find(pageIdx) }; it != this->bmBuffer.end())
{
if (it->second.pos == pos && it->second.size == size)
if (it->second.size == size)
{
reRender = false;
}
}

if (reRender)
{
this->bmBuffer[pageIdx] = RenderStats(render(renderArg), pos, size);
this->bmBuffer[pageIdx] = RenderStats(render(renderArg), size);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/hdcbuffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace pdfv::hdc
struct RenderStats
{
RenderT hrender;
xy<int> pos, size;
xy<int> size;
};

private:
Expand Down Expand Up @@ -45,7 +45,7 @@ namespace pdfv::hdc
* @param render Rendering function, returns RenderT object
* @param renderArg Argument to the rendering function
*/
void putPage(std::size_t pageIdx, xy<int> pos, xy<int> size, std::function<RenderT (void *)> render, void * renderArg);
void putPage(std::size_t pageIdx, xy<int> size, std::function<RenderT (void *)> render, void * renderArg);

/**
* @param pageIdx Page index
Expand Down
1 change: 0 additions & 1 deletion src/lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ pdfv::error::Errorcode pdfv::Pdfium::pageRender(HDC dc, pdfv::xy<int> pos, pdfv:
void * args[]{ this, dc, &newsize };
this->m_optRenderer.putPage(
this->m_fpagenum,
pos,
newsize,
[](void * args) -> hdc::Renderer::RenderT
{
Expand Down
4 changes: 3 additions & 1 deletion src/tabs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ LRESULT pdfv::Tabs::tabsCanvasProc(UINT msg, WPARAM wp, LPARAM lp)
si.fMask = SIF_POS;
si.nPos = tab->page;
::SetScrollInfo(this->m_canvashwnd, SB_VERT, &si, true);

::SendMessageW(this->getCanvasHandle(), Tabs::WM_ZOOMRESET, 0, 0);
}
break;
}
Expand All @@ -144,7 +146,7 @@ LRESULT pdfv::Tabs::tabsCanvasProc(UINT msg, WPARAM wp, LPARAM lp)
if (tab != nullptr && tab->second.pdfExists())
{
auto prevzoom{ tab->zoom };
tab->zoom += float(int(wp)) / float(WHEEL_DELTA);
tab->zoom += float(int(wp)) / float(10 * WHEEL_DELTA);
tab->zoom = std::clamp(tab->zoom, 1.0f, 10.0f);
if (prevzoom != tab->zoom)
{
Expand Down
6 changes: 3 additions & 3 deletions src/version.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#define APP_CLASSNAME L"PdfiumViewCpp"
#define VERSION_STRING L"0.7b"
#define VERSION_STRING L"0.8b pre1"
#define PRODUCT_NAME L"PdfiumView"
#define APP_NAME PRODUCT_NAME L" v" VERSION_STRING

Expand All @@ -19,8 +19,8 @@
" * Ability to open hyperlinks/websites\n\n" \
"The project is open for any feature requests. Post them under the Issues tab in GitHub."

#define VERSION_SEQUENCE 0,7
#define VERSION_SEQUENCE_STR "0.7"
#define VERSION_SEQUENCE 0,8
#define VERSION_SEQUENCE_STR "0.8"

#define DEFAULT_OPEN_FILTER L""
#define DEFAULT_OPEN_TITLE L""

0 comments on commit d4a7aa1

Please sign in to comment.