mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-07-05 09:38:40 +00:00
remove hypot
This commit is contained in:
parent
091b623872
commit
250d23c712
|
@ -104,7 +104,7 @@ static void get_shading_bbox(GfxState * state, GfxShading * shading,
|
||||||
*/
|
*/
|
||||||
static double get_angle(double dx, double dy)
|
static double get_angle(double dx, double dy)
|
||||||
{
|
{
|
||||||
double r = hypot(dx, dy);
|
double r = _hypot(dx, dy);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* acos always returns [0, pi]
|
* acos always returns [0, pi]
|
||||||
|
@ -358,7 +358,7 @@ void HTMLRenderer::css_draw_rectangle(double x, double y, double w, double h, co
|
||||||
|
|
||||||
double i1 = (new_tm[0] + new_tm[2]) / sqrt2;
|
double i1 = (new_tm[0] + new_tm[2]) / sqrt2;
|
||||||
double i2 = (new_tm[1] + new_tm[3]) / sqrt2;
|
double i2 = (new_tm[1] + new_tm[3]) / sqrt2;
|
||||||
scale = hypot(i1, i2);
|
scale = _hypot(i1, i2);
|
||||||
if(_is_positive(scale))
|
if(_is_positive(scale))
|
||||||
{
|
{
|
||||||
for(int i = 0; i < 4; ++i)
|
for(int i = 0; i < 4; ++i)
|
||||||
|
|
|
@ -17,13 +17,12 @@
|
||||||
|
|
||||||
#include "HTMLRenderer.h"
|
#include "HTMLRenderer.h"
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
namespace pdf2htmlEX {
|
namespace pdf2htmlEX {
|
||||||
|
|
||||||
using std::max;
|
using std::max;
|
||||||
using std::abs;
|
using std::abs;
|
||||||
using std::hypot;
|
|
||||||
|
|
||||||
void HTMLRenderer::updateAll(GfxState * state)
|
void HTMLRenderer::updateAll(GfxState * state)
|
||||||
{
|
{
|
||||||
|
@ -148,7 +147,7 @@ void HTMLRenderer::check_state_change(GfxState * state)
|
||||||
double new_draw_text_tm[6];
|
double new_draw_text_tm[6];
|
||||||
memcpy(new_draw_text_tm, cur_text_tm, sizeof(new_draw_text_tm));
|
memcpy(new_draw_text_tm, cur_text_tm, sizeof(new_draw_text_tm));
|
||||||
|
|
||||||
double new_draw_text_scale = 1.0/text_scale_factor2 * hypot(new_draw_text_tm[2], new_draw_text_tm[3]);
|
double new_draw_text_scale = 1.0/text_scale_factor2 * _hypot(new_draw_text_tm[2], new_draw_text_tm[3]);
|
||||||
|
|
||||||
double new_draw_font_size = cur_font_size;
|
double new_draw_font_size = cur_font_size;
|
||||||
if(_is_positive(new_draw_text_scale))
|
if(_is_positive(new_draw_text_scale))
|
||||||
|
|
|
@ -46,6 +46,7 @@ static inline bool _tm_equal(const double * tm1, const double * tm2, int size =
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
static inline double _hypot(double x, double y) { return std::sqrt(x*x+y*y); }
|
||||||
|
|
||||||
void _tm_transform(const double * tm, double & x, double & y, bool is_delta = false);
|
void _tm_transform(const double * tm, double & x, double & y, bool is_delta = false);
|
||||||
void _tm_multiply(double * tm_left, const double * tm_right);
|
void _tm_multiply(double * tm_left, const double * tm_right);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user