<div dir="ltr"><div dir="ltr"><span style="color:rgb(32,33,36);font-family:"Google Sans",Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-size:22px;font-variant-ligatures:no-contextual">Pull Request #5712 Follow Up</span><br><div>Hello, guys in the last email I forgot to mention that what my PR actually does also link to the PR: <a href="https://github.com/mapserver/mapserver/pull/5712">https://github.com/mapserver/mapserver/pull/5712</a></div><div>My PR solves the issue </div><h1 class="gmail-gh-header-title" style="box-sizing:border-box;margin:0px 150px 0px 0px;font-weight:400;line-height:1.125;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol""><span class="gmail-gh-header-number" style="box-sizing:border-box;color:rgb(163,170,177);letter-spacing:-1px"><font size="4">#5310</font></span></h1><div><h1 class="gmail-gh-header-title" style="box-sizing:border-box;margin:0px 150px 0px 0px;font-weight:400;line-height:1.125;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol""><span class="gmail-js-issue-title" style="box-sizing:border-box"><font size="4">Styles' OFFSET values are saved as ints though they are doubles. </font></span></h1></div><div><span class="gmail-js-issue-title" style="box-sizing:border-box"><p style="box-sizing:border-box;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px;margin-top:0px">In mapserver.h (row 1006) we can see the styleObj struct has offsetx and offsety. They are double.</p><p style="box-sizing:border-box;margin-bottom:16px;margin-top:0px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">mapserver.h</p><p style="box-sizing:border-box;margin-bottom:16px;margin-top:0px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">struct styleObj{<br style="box-sizing:border-box">...<br style="box-sizing:border-box">double offsetx, offsety; /* for shadows, hollow symbols, etc... */<br style="box-sizing:border-box">...<br style="box-sizing:border-box">}</p><p style="box-sizing:border-box;margin-bottom:16px;margin-top:0px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">According to this we can see in mapfile.c (row 2726 and 2736) they are treated as doubles when they are loaded in.</p><p style="box-sizing:border-box;margin-bottom:16px;margin-top:0px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">mapfile.c</p><p style="box-sizing:border-box;margin-bottom:16px;margin-top:0px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">int loadStyle(styleObj *style)<br style="box-sizing:border-box">{<br style="box-sizing:border-box">...<br style="box-sizing:border-box">case(OFFSET):<br style="box-sizing:border-box">if((symbol = getSymbol(2, MS_NUMBER,MS_BINDING)) == -1) return(MS_FAILURE);<br style="box-sizing:border-box">if(symbol == MS_NUMBER)<br style="box-sizing:border-box">style->offsetx = (double) msyynumber;<br style="box-sizing:border-box">else {<br style="box-sizing:border-box">...<br style="box-sizing:border-box">if(symbol == MS_NUMBER)<br style="box-sizing:border-box">style->offsety = (double) msyynumber;<br style="box-sizing:border-box">else {<br style="box-sizing:border-box">...<br style="box-sizing:border-box">}</p><p style="box-sizing:border-box;margin-bottom:16px;margin-top:0px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">But in mapfile.c (row 2986) the style is saved by a writeDimension (mapfile.c row 525) function which wait ints on its 4th and 5th operands<br style="box-sizing:border-box">that is why the OFFSET value of styleObj losts the precision of double when the map file is saved.</p><p style="box-sizing:border-box;margin-bottom:16px;margin-top:0px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">mapfile.c</p><p style="box-sizing:border-box;margin-bottom:16px;margin-top:0px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">...</p><p style="box-sizing:border-box;margin-bottom:16px;margin-top:0px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">static void writeDimension(FILE *stream, int indent, const char *name, int x, int y, char *bind_x, char *bind_y)<br style="box-sizing:border-box">{<br style="box-sizing:border-box">writeIndent(stream, ++indent);<br style="box-sizing:border-box">if(bind_x) msIO_fprintf(stream, "%s [%s] ", name, bind_x);<br style="box-sizing:border-box">else msIO_fprintf(stream, "%s %d ", name, x);<br style="box-sizing:border-box">if(bind_y) msIO_fprintf(stream, "[%s]\n", bind_y);<br style="box-sizing:border-box">else msIO_fprintf(stream, "%d\n", y);<br style="box-sizing:border-box">}</p><p style="box-sizing:border-box;margin-bottom:16px;margin-top:0px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">...</p><p style="box-sizing:border-box;margin-bottom:16px;margin-top:0px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">void writeStyle(FILE *stream, int indent, styleObj *style)<br style="box-sizing:border-box">{<br style="box-sizing:border-box">...<br style="box-sizing:border-box">writeDimension(stream, indent, "OFFSET", style->offsetx, style->offsety, style->bindings[MS_STYLE_BINDING_OFFSET_X].item, style->bindings[MS_STYLE_BINDING_OFFSET_Y].item);<br style="box-sizing:border-box">...<br style="box-sizing:border-box">}</p><p style="box-sizing:border-box;margin-bottom:16px;margin-top:0px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">And in my PR I have presented a possible solution to this.</p><p style="box-sizing:border-box;margin-bottom:16px;margin-top:0px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">Thank You</p></span></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Nov 27, 2018 at 6:55 AM Shubham Sharma <<a href="mailto:klusbn@gmail.com">klusbn@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">Hi I am Shubham <div dir="auto"><br><div dir="auto">A student in Google code-in working with osgeo organisation and have created the pull request #5712 as a part of a task please review it as soon as possible so that I can submit my task.</div><div dir="auto"><br></div><div dir="auto">Thank you </div></div></div>
</blockquote></div>