]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/m_image.cpp
Ifdef'ed back in the scrolling aware drawing code in wxHtmlWidgetCell
[wxWidgets.git] / src / html / m_image.cpp
index 556bbe4fdfcabdee4775cc3e6c280e51c15e9b61..60bb5f5734489dc94e48dc67fafcb454ff2df131 100644 (file)
@@ -107,7 +107,7 @@ wxString wxHtmlImageMapAreaCell::GetLink( int x, int y ) const
                        l = coords[ 0 ];
                        t = coords[ 1 ];
                        r = coords[ 2 ];
                        l = coords[ 0 ];
                        t = coords[ 1 ];
                        r = coords[ 2 ];
-                       d = sqrt( ((x - l) * (x - l)) + ((y - t) * (y - t)) );
+                       d = sqrt( (double) (((x - l) * (x - l)) + ((y - t) * (y - t))) );
                        if (d < (double)r)
                        {
                                return m_Link;
                        if (d < (double)r)
                        {
                                return m_Link;
@@ -382,7 +382,7 @@ TAG_HANDLER_BEGIN(IMG, "IMG, MAP, AREA")
 
                    str = m_WParser -> GetFS() -> OpenFile(tmp);
                    if (tag.HasParam("WIDTH")) tag.ScanParam("WIDTH", "%i", &w);
 
                    str = m_WParser -> GetFS() -> OpenFile(tmp);
                    if (tag.HasParam("WIDTH")) tag.ScanParam("WIDTH", "%i", &w);
-                   if (tag.HasParam("HEIGHT(")) tag.ScanParam("HEIGHT(", "%i", &h);
+                   if (tag.HasParam("HEIGHT")) tag.ScanParam("HEIGHT", "%i", &h);
                    al = HTML_ALIGN_BOTTOM;
                    if (tag.HasParam("ALIGN")) {
                        wxString alstr = tag.GetParam("ALIGN");
                    al = HTML_ALIGN_BOTTOM;
                    if (tag.HasParam("ALIGN")) {
                        wxString alstr = tag.GetParam("ALIGN");
@@ -441,16 +441,16 @@ TAG_HANDLER_BEGIN(IMG, "IMG, MAP, AREA")
                        {
                                cel = new wxHtmlImageMapAreaCell( wxHtmlImageMapAreaCell::CIRCLE, coords );
                        }
                        {
                                cel = new wxHtmlImageMapAreaCell( wxHtmlImageMapAreaCell::CIRCLE, coords );
                        }
-                       else if (tmp == "RECT(")
+                       else if (tmp == "RECT")
                        {
                                cel = new wxHtmlImageMapAreaCell( wxHtmlImageMapAreaCell::RECT, coords );
                        }
                        {
                                cel = new wxHtmlImageMapAreaCell( wxHtmlImageMapAreaCell::RECT, coords );
                        }
-                       if (cel && tag.HasParam("HREF"))
+                       if (cel != NULL && tag.HasParam("HREF"))
                        {
                                wxString tmp = tag.GetParam("HREF");
                                cel->SetLink( tmp );
                        }
                        {
                                wxString tmp = tag.GetParam("HREF");
                                cel->SetLink( tmp );
                        }
-                       m_WParser->GetContainer()->InsertCell( cel );
+                       if (cel != NULL) m_WParser->GetContainer()->InsertCell( cel );
                }
        }
 
                }
        }