1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-07-03 00:35:40 +00:00

remove hypot

This commit is contained in:
Lu Wang 2012-10-06 15:06:26 +08:00
parent 091b623872
commit 250d23c712
3 changed files with 5 additions and 5 deletions

View File

@ -104,7 +104,7 @@ static void get_shading_bbox(GfxState * state, GfxShading * shading,
*/
static double get_angle(double dx, double dy)
{
double r = hypot(dx, dy);
double r = _hypot(dx, dy);
/*
* 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 i2 = (new_tm[1] + new_tm[3]) / sqrt2;
scale = hypot(i1, i2);
scale = _hypot(i1, i2);
if(_is_positive(scale))
{
for(int i = 0; i < 4; ++i)

View File

@ -17,13 +17,12 @@
#include "HTMLRenderer.h"
#include "namespace.h"
#include "util.h"
namespace pdf2htmlEX {
using std::max;
using std::abs;
using std::hypot;
void HTMLRenderer::updateAll(GfxState * state)
{
@ -148,7 +147,7 @@ void HTMLRenderer::check_state_change(GfxState * state)
double new_draw_text_tm[6];
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;
if(_is_positive(new_draw_text_scale))

View File

@ -46,6 +46,7 @@ static inline bool _tm_equal(const double * tm1, const double * tm2, int size =
return false;
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_multiply(double * tm_left, const double * tm_right);